A compressor turns a signal down when it rises above a set threshold. The ratio decides how strongly: at 3:1, a sound that goes 6 dB over the threshold comes out only 2 dB over. Attack sets how quickly the compressor reacts, so a slow attack lets the initial snap of a snare through before the level is reduced, and release sets how quickly it lets go. Because compression lowers the peaks, makeup gain is then used to raise the overall level again.
Gentle compression makes a part more even and present; heavy compression flattens dynamics and can cause audible pumping. In jazz lo-fi, compressors help glue drums together and keep sampled loops at a steady, unobtrusive level, which suits music meant to stay calmly in the background. Compression of audio dynamics should not be confused with data compression such as MP3.