This is how compression works, affliction or the other production gurus might want to add to this if i missed something out
A compressor monitors the signal then alters the volume when it gets to a certain point
Threshold : The level at which it starts changing the volume
Ratio : How the volume is changed (positive ratio for compression, negative for expansion)
Attack : How quickly it changes the volume
Decay : How quickly the volume returns to the normal level
Hard / Soft compression : The way the volume changes, resulting in a smooth sound (soft) or a harsh one (hard)
May have Input and Output levels as well
If you use it on a long sound it'll make the quiet bits louder, as the louder bits will be reduced in volume, this reduces the dynamic range quite a bit tho. It can be used to get that extra bit of volume on your final mixdown, as it brings the peaks of the sound down a bit so you can boost the volume
Check the hammering amens in Twisted Anger - Dread come 2 conquer
Compression is used in this break to give it constant volume, and as a result the break is really "fat" sounding
When used on a short stabbing sound (like a drum) you can make it punch by having a long attack and low ratio so it stabs in then fades quickly. When using this technique it's best to take each individual sound, compress then render and load into your sampler
Kemal and Total Science often use compression on individual sounds to make them stab in and out quickly and sound choppy (in the case of total science often the break is chopped into its various hits, which are processed individually, then the break is reassembled into its original pattern, like the break in kingpin or the amen in dubplate remix so each drum kicks in nicely)
In clubs these are used to limit the signal coming through the amp so the equipment doesn't get damaged
There are also multiband compressors where you have a separate ratio, attack and release for each freqency band which is more flexible in some cases
Some compressors have an "expander" function (uses a negative ratio) so that you can boost the volume when it gets to a certain volume to give the sound an increased dynamic range instead of flattening the dynamics. I find it good for minimal tracks where you can hear the quietest bits, but not so good for real loud tunes
Pretty simple to use, not as in depth as a compressor
How they work is by gently cutting the sound above the threshold level to get maximum volume.
A typical limiter will have a threshold and output level and some controls to adjust the way it shapes the sound above the threshold level.
If you mess around you'll notice that they work well on long sounds that have very little dynamics (strings perhaps) but tend to mess up stabbing sounds like beats if you push the threshold too much, losing the punch of the sound.
Think about the dynamics and quality of the sound and how an effect works in order to choose the right effect for the job!