Good sources above but just a couple of comments.
1. Can be used for ducking a track or group. Radio does this when you hear the voice come forward and the music behind go down, but just when the voice is talking.
2. Can be used when two instruments compete for frequency range and you want one turned down slightly when the other is active. i.e. the kick for some types of music needs to be in your face. Duck the bass guitar which is in the same frequency range when the kick strikes. This gives you consistent punch.
3. Frequency specific ducking. Put an EQ in front of the compressor so that only a specific range is available when the compression starts. Let's say you want an acoustic guitar to duck slightly in the vocal range keyed by the voice or even the frequency range of another guitar.
4. Frequency specific ducking for reverb to control the reverb when a voice comes in loud.
Lot's of uses. But the kick/bass and voice vs. music are the generally the most often used.