Look at any professional guitarist's assortment of foot pedals – you'll find pedals for Overdrive, Fuzz, Flangers, Chorus, Distortion, to name a few. One you'll almost always find … and one you might not expect … is a compression pedal. Why? What does a compression pedal do?
In it's simplest form, a compression "squeezes" a guitar's tone. The analog tone from a guitar consists of a great many frequencies – a compression pedal addresses and squeezes the range to even out the tone. This makes the resulting tone more consistent and level.
Compression pedals even off the loud parts and beef up the quiet parts – this not only levels out the tone, but also yields greater sustainability.
Of course, this does come at a cost – by squeezing the tone, you diminish the dynamic range. However, the payoff is a fatter tone and a more consistent level.
So why are there so many compression pedals if this all they do? Well, for the same reason there's a variety of other effects pedals – they sound different from brand to brand!
The electronic components inside the pedal, the different gain and tweeting settings available, the particular "style" of desired tone (bright sparkly country? Or phat Southern rock?) The treatment of different frequencies – all lend to the taste of the resulting tone . Like anything else, you've really got to sit down and try a multitude of compression pedals to find the right one for your playing.
Compression effects work well on electric guitars – but can also help acoustic and bass players as well by providing a more consistent tone. While you may not use a compression pedal as your only effect, it's very common for it to be the first pedal in the chain.