I don't want to confuse but this is usually done as part of "side chain compression"
The concept is actually very simple
If you understand that one of the functions of a compressor is to reduce the loud bits of a signal to smooth it out by evening the volume then side chain compression is exactly the same - but rather than using the track it is applied to as the trigger for the compressor it uses ANOTHER track
To explain with an example...
If you have a bass guitar track with the occasional note hit very hard by the player (because they were getting excited whilst recording) you could use a compressor on the bass track to reduce the volume of just the really hard hits to make it more "even". To do this the compressor "listens" to the bass track and when the volume exceeds a certain threshold (that you can set) the volume of the note that exceeds this threshold is reduced by an amount you can set (usually expressed as a ratio). You can also tell the compressor how quickly you want it to reduce the volume after it exceeds the threshold using the ATTACK control (e.g. You may want the initial thumb of the bass note but then reduce the volume) and you can control how long the compressor reduces the volume (using the RELEASE control)
DUCKING is usually achieved when you want to reduce the volume of one track at certain points - e.g. Reduce the music volume to hear a vocal (such as in voiceover work) or reducing one track momentarily so that another can be heard more clearly
Sticking to our BASS example - I now want the bass volume to reduce every time the kick drum hits as I really want the kick drum to be prominent in my track
In this case I set up a compressor on my BASS track (as this is the track I want to "duck" - i.e.reduce the volume of the bass so that it ducks out of the way of the kick) - but this time I create a SEND from my KICK track to the side chain input of my compressor
With this set up (and some tweaking) the compressor is now listening to the KICK track and reducing the volume of the BASS track every time the KICK drum hits
This is a very common application of "ducking"
Another common application of side chain compression is to set the compressor on a synth pad and set the side chain in the same way from the kick drum
This means the synth rhythmically changes volume and "ducks" out of the way of the kick drum - giving a pumping effect to synth and ensures the synth doesn't "mask" the kick
I hope this helps explain and gives some context - feel free to ask any follow up questions if you need to