A compressor is a device that reduces the dynamic range of an audio signal. The amount of dynamic range reduction is determined by the setting of both the threshold and the ratio. To activate the compressor, the threshold must be set below some or all of the loudest elements of the signal. The ratio determines the amplitude reduction of the signal that exceeds the set threshold. For example, if the signal exceeds the set threshold by 10dB and the ratio set at 2:1, the output above the threshold will be 5dB, dynamic range of the signal below the threshold will remain unchanged.
Typically in recording and broadcast applications (and with some degree of caution, live applications as well), compressors are often used to increase the overall volume of a signal without exceeding the maximum capacity of the audio system. If you take the above example of a signal that has been reduced by 5dB, this has created 5dB more of headroom which you can use to increase the overall level of the signal. Because the quietest and loudest components of the signal have been brought 5dB closer together, this has a smoothing effect on the overall dynamic range. In live applications, a compressor is most often used to squash extreme and unexpected loud input signal to decrease the chance of feedback