The purpose of a compressor is to make soft sounds louder and loud sounds softer. They are also known a leveling amplifier. Compressors make audio louder, bigger, punchier, richer, and more powerful. They are used in nearly every piece of music created. There are several types of compressors and each has different controls and function differently.
Vari-mu compressors were based on variable-mu tubes (valves). They compressors have no ratio controls. They provide incremental amount of gain reduction but only happens to a point, when the compressor returns to linearity. This works well with percussion instruments or as loud transients instruments. These compressors have faster attack and release times than optical compressors but not as fast VCA or Fet compressors.
FET compressors use small transistors. They have faster attack and release times as well as ratio setting. The ratio functions like Vari-mu compressor and returns loud input signal to linearity.
Opt or optical compressor exhibits the slowest response times of all compressors. On the gain stage there is a photo resister that affects the amount of applied gain. The side chain of an optical compressor controls the brightness of a bulb or LED. These compressors have a very noticeable effect.
VCA or voltage-controlled amplifiers provide the most precise and controlled gain manipulation. These are solid-state compressors.
Digital compressors work using mathematical operations. These are the most precise compressors ever. These compressors also have ratio, attack, and release curves.
The threshold control is the level above where gain reduction starts. Any signal above the threshold will be reduced. The signal below the threshold is not affected.
There are two types of threshold, variable threshold & fixed threshold. Variable threshold provides a dedicated control for the threshold, basically its own control. A fixed threshold has input gain control. So the more input signal there is, the more signal above the threshold there is. Compressors that have fixed threshold also have output control to manage the amount of gain reduction.
The ratio control determines the ratio between input level changes and output level changes. The ratio determines how the overshooting signals above the threshold are scaled down.
Attack is how fast the gain reduction starts and is also known as time constants. The release controls how fast the gain reduction stops also known as response time. If these are not set properly then they can cause a pumping or breathing sound. Typically the attack time is faster than the release time.
These are just some of the basic functions of a compressor. Choosing which ones to used are based one knowing what each sounds like and how you want to implement that into your mix.
Izhaki, Roey; Mixing Audio; Concepts, Practices and Tools; Second Edition