This is actually called sidechain compression. It is usually applied to pads, or basslines with higher frequencies (but not always) and then a kick drum is often used as the 'input' for the compressor. The kick drum hits and just like when you listen to the radio, when the dj/presenter talks over the music, the volume dips. The attack, delay, hold and compression ratio can all be adjusted to give a sharp dip or a more gradual dip with a pumping effect. It is quite a common technique especially in dance music these days.
It is not usually a technique applied to the whole mix (i.e. all the channels), it is usually done on parts of the mix (i.e. specific channels). A compressor is however usually added at the end on the master channel but not for this effect.
Generally, it is applied to the channel that wish to dip using another channel as the input for the compressor. The compressor on the master bus can produce this effect but it is not generally used for this effect as it affects ALL the instrument parts. Generally the compressor on the master bus is used to 'glue' the track together i.e. lower the volume of the 'louder' parts and increase the volume of the 'quieter' parts (at the expense of dynamics of course).
A good example is this:
notice (when the main tune is in flow) the kick drum lowers the volume of the synth but does not affect the vocals. A few bars later the compression is then applied to the vocals which you can hear instantly.