Although a Compressor pedal can be used as an obvious effect, it's more likely to be used as a subtle tool to adjust the tone of the guitar. What a compressor does isn't always that obvious. BUT, take it away and you will notice the effect, guaranteed!
In brief compression pedals will attenuate, sustain or squash any signal peaks, that's the noise you make when you strike the strings, unless you strike evenly the expression could highlight imperfections in your playing.
A compressor pedal will ensure your transmitted audio signal is within limits and controlled throughout. Added features to sustain gain and mix can significantly affect the overall tone. An essential pedal for recording, performance & studio use.