Hi!
Compression is the name given to the process of electronically lowering dynamic range of a piece of music.
Players use compression in 2 different ways; firstly to flatten the dynamic range of the guitar, raising the volume of quiet nots and scrapes so that they become part of the music; and secondly as an effect removing or reducing attack while raising the decay to produce an effect similar to playing a chord on a piano.
Each of this effects is produced when the difference between the loudest and quietest sounds in the passage of music is reduced. A compressor electronically turns the volume up during quiet dips and down during loud peaks.