A compressor does exactly what its name implies; it compresses the loud parts of your audio signal, making the difference between the highs and lows in your signal smaller. Here are the basic controls of compression and what they do:
Threshold: This is the level at which the compressor activates. If the signal is below the threshold, no compression is applied. If the signal level goes above the threshold, the signal is compressed according to the ratio.
Ratio: This is the ratio of compression that is applied to the signal if it goes above the threshold. The ratio is displayed as 2:1, 3:1, 4:1, etc. This means that for every 2, 3, or 4 dB (respectively) that the signal goes above the threshold, you will only hear 1 dB increase in volume. So, if compression ratio were 8:1, the signal would have to increase by 8 dB in order to hear 1 dB of difference.
A ratio of 1:1 would be equivalent to not having any compression, because for every 1 dB increase in thesignal, you will have 1 dB increase in the sound. Attack: This refers to how quickly the compression is applied when the signal goes above the threshold. This can range from 1 millisecond (ms) to 100 ms.
Release: This refers to how quickly the compression is turned off after it is triggered. This typically ranges from 20 ms to 250 ms. Gain: Because the compression causes the entire signal to decrease in amplitude, the gain (or makeup gain) helps to bring the overall volume of the track back up in the mix. This can be set anywhere from 0 to +10dB.
The best way to figure out compressors is to practice with them. Different instruments will require different amounts of compression and different attack and release times. Ultimately, a good ear and practice will help you to discern the appropriate settings for your situation.