Life is full of mysteries. Such as “If vegetarians eat vegetables, what do humanitarians eat?” And, “Whose cruel idea was it for the word "lisp" to have an "s" in it?” For many guitarists, the compressor is a mysterious effect. But if I had only one pedal on my board, it would have to be a compressor.
Compressors were born out of need in recording studios. In simple terms, what they do is reduce the dynamic range of a signal, i.e. the difference between the softest and loudest volumes. Their original purpose was to avoid distorting recordings by “squishing” transient loud peaks. But wily guitarists figured out that a compressor can also have the effect of lengthening sustain by increasing the volume as the signal fades out. Judicious use of a compressor can add punch, clarity, smoothness to your tone. Perhaps best of all, it can make your guitar sound louder, without actually increasing its volume.
Some compressors have a “Studio” quality to their sound. That is to say, that they are sonically transparent and subtle. For guitar, I prefer a compressor that gets right up in your face and squeezes the snot out of the incoming signal. There, I said it. A compressor is an “effect”.
Give a listen to the parallel guitar line in the Beatle's “Drive My Car”. Or Roger McGuinn's chiming Rickenbacker 12-string on “Eight Miles High”. If you like the “up front” tonality of these tracks, you should consider adding a compressor to your signal chain. You might find out that you don't even notice that it's there, like missspelled words.