compression is an effect triggered when the sound it's used on exceeds the THRESHOLD setting. so a threshold close to 0 db means the effect will only be triggered by loud sounds, and a threshold close to -infinity db will mean almost any sound, including really really quiet sounds will trigger the effect.
once you have that established, you have to deal with the actual effect. the ATTACK setting controls how long it takes for the compression to kick in once the effect is triggered by a sample which exceeds the amplitude of the threshold setting. the DECAY setting controls how long it takes for the compressor to stop compressing after the attack time has passed. the RATIO is the amount the audio is compressed after the compressor is triggered.
knowing that, it's easier to choose the parameters you will use on different elements.
if you're dealing with something punchy, like a snare, and you just want to make it as loud as possible throughout, then you're going to have to use a really short attack time (0 or 0.5 ms), a really short release time (1-2 ms), a low threshold, and a high ratio. as soon as the snare starts to make a sound, the threshold level will be tripped, and the compressor will respond and squash the amplitude by an amount proportional to the ratio (which will be a lot cuz you used a high ratio). as the snare gets quieter and gets into the tail, the compressor will still be squashing, but not as much -- because, of course, the tail of the snare is quieter than the initial snap. and so, you will be able to turn your snare way the fuck up because the initial snap got the most squishing, and yet you'll still be able to hear the tail loud and clear.
now if you don't want to make that snare as loud as possible, but are instead interested in making the snare snappy, you WANT to preserve the initial snap, and you want to cut down on that tail. so you use all the same settings as above, but a medium attack time (say 50 ms) instead of a super short one. when the snare first begins to occur, the compressor will immediately be triggered. however, the compression will not reach its height for 50 ms. so the snare gets to make 50 ms worth of sound before it gets clamped down. as a result, if you turn up the volume on a snare compressed this way, you mostly just hear the snap, and the tail is hard to make out.
personally, i use 0 ms attack, 0.5 ms decay, 25:1 ratio, -30 db threshold on my "flowing" basslines -- i want them to be as loud as possible without having any percussive effects (no snappiness is desired). on percussive sub basslines, i use similar settings, only i move the threshold closer to zero, reduce the ratio a bit, and up the attack by a few ms to give room for some snap.
just some ideas. i'm sure a lot of you know more than me about this sort of thing, but the above might benefit starry eyed n00b producers or people whose memory has lapsed