Before we get in to detail technical discussions let me update you with the process of learning. I prefer to explain things in the simplest manner and use day-to-day examples, which every individual can relate to.  “A good teacher is the one who explain the most complex topic in the most simple way.”
What is a compressor ?
A machine that can compress !!! Yes you are right , you all have heard of a compressor in your refrigerator, air conditioner, even when you go to check air pressure in your scooters tyers !!! All these are compressors . Since we are in to audio , the unit which can compress audio is called audio compressor.
In the first place what is the need to compress audio ? We need to compress anything only when we have a limited space and we have to fit in more material or data ( than the given space can handle ) in that given space. Yes logically this definition is correct. In audio world also this definition is not wrong , but audio compression also does more to audio than just fitting it in the given space . We will understand each of them separately .
Lets see what is the “given space” !!  Human ear has a limited hearing range . Its called the dynamic range . ( please read the audio fundamentals tutorial for details)
We have a 120db spl dynamic range . The maximum level we have is 0 db. ( i am trying to make it simple ) since the loudest sound can not be more than 0 db. Remaining in the metered limits if we still intend to make the sound louder in terms of spl we need to compress it . The dynamic range is the difference between the softest and the loudest . When we compress we end up increasing the soft and decreasing the loud . Which eventually also affects a lot of other factors.
Compressor can be used for a few different purposes, one of the most common is to turn loud sections in your audio lower without affecting the already quieter passages. For example, when your audio has very large volume peaks but the average volume of the sound, the rms, is not very loud, you could then apply some compression to bring the peaks down and then boost the overall volume of it to increase the average volume.
Here is an image of an audio where the first half of the clip was is louder than the second half, now if i set the volume knob for a comfortable listening level according to the first part then the second half will be not audible, and if i set my listening level with ref to second part than the first part will be way too loud and clip. After compressing the audio though, you’ll see that only the audio that was above the threshold was lowered in volume, and the whole thing is a bit more leveled out now. I can now boost the overall signal louder without worrying about the beginning going over 0db and clipping so quickly. (don’t worry ill explain the threshold next)
We use this term casually in our day-to-day activities. We all have been tried for our patience . Every person has a limit of tolerance, the moment when we stop tolerating and start reacting is our threshold. Similarly in audio compressor, the user defines the threshold; the moment audio signal crosses the threshold the compressor comes in to the above image the threshold is set at -15db, meaning the moment the audio signal crosses -15db the compressor will start acting. In the image you will notice that resultant  compressed signal is below -15db.
Attack has a similar meaning as in the logical world, its represented in ms. ( time )
This determines the speed with which you want the compressor to act, on the audio as soon as the threshold is crossed.
Let me make it simpler, when someone crosses the threshold of your patience and you are about to react, how harsh is your reaction? If its very harsh, it can be termed as fast attack, if you would not react harsh and react slowly, its slow attack.

The audio signal has crossed the threshold, the attack time has been decided , now the action needs to be defined . The action is supposed to be reduction of audio signal. How much reduction is intended is defined by the ratio . 2:1 ratio means that if the signal was 2 db louder than the threshold it should be reduced to 1 db. This is called soft compression. 5:1 ratio means that if the signal was 5db louder than threshold, it should be reduced to 1db. This is called hard compression 100:1 ratio is a maximum meaning anything above the threshold should be brought down to 1db. This is called very hard compression and also called limiting.
Simply the action you take to stop the person irritating you. He can be warned (soft compression) he can be yelled at( hard compression ) you can hit him !! (limiting)

Release is also represented in ms.(time ) this is exactly opposite to attack . After the audio has crossed the threshold and compression is done and the original signal is now again below the threshold , release time defines how fast or slow will the audio signal come to its original level.
Again with our example, your patience was tested, you decided to react, you defined the attack time, your reaction delivered the desired response, and the one who was irritating you has gone back and stopped irritating you . Now you are cooling down. How soon do you cool down is the release time. If you cool down fast and become normal its fast release, if it takes time then its slow release.
Now that we understand compressors in lay man terms, lets go deeper technically. When we compress an audio signal with our choice of settings , we effectively are limiting the transient peaks in the audio signal. The gain reduction meter is displaying , how much of gain is being reduced . The amount of gain which is reduced needs to be compensated , or your audio will become softer after compression.
Typical application of compressors.
  • Compressors can be used just to limit peaks and avoid the signal to clip . ( typically used during recording a signal. This can be done before sending the signal to the recorder. Which means its commited to the recorded audio.)
  • To adjust and make audio signal sit in to the track . What does that mean ? Ok when you are mixing a track , you have reached a point where you have balanced your drums,percussions, guitars, strings,and finally when you open the voice track , you find that the lower notes or softer words are dying up in the track . And you are hardly left with any headroom to increase the level . That’s when a compressor can help you to fit that vocal in to the track.
  • Lot of hardware compressors and even plugin compressors add a specific charechter to the audio. Now trust me you need experience to understand and hear that change in the charechter . It takes time and experience to know it and achieve it . But you can trust your seniors & plugin manufacturers for that . My strong recommendation is to learn to find the difference in the audio after you use these plugins . Its as complex as understanding a pitch or understanding god !!.

The compensation for the gain reduction done is important ,and for that we are provided with a makeup gain knob. Easiest way to set this is read the gain reduction meter and get an average or if the gain reduction hits -6db at peaks set the makeup at 4.5db and you are set.
Compression techniques differ for each instrument and audio signal, but fundamentals are same. Its your craft how you make the optimum use of it to beautify the audio signal. Also keep in mind, this is the most dangerous tool you have, if used without understanding it you can damage your audio and reputation seriously.  So the final word i would like to say is …
“Compress with care “

You may also like

Introduction to consoles
Introduction To Consoles
Understanding The Way To Organize Cables
Understanding Different Types of Connectors

Pramod Chandorkar