In modern recording (in the old days, they didn't have compressors, and the world did not come to an end), compression is used for control of dynamics, not to expand dynamic range. It is also used to allow music to be recorded and mastered at a higher level without clipping. In the first case, say you have a singer or a drummer that occasionally hits one loud rim shot or one loud note that makes you want to reach and turn the volume down. By compressing that one source at mixdown, you can control those excursions. In the second case, it is a symptom of the volume wars, where the whole mix is squashed so perfectly reasonable dynamic excursions don't cause clipping, because the whole level is so close to clipping in the first place. It can also be used as an effect, especially on bass and percussion, so hard slaps and rim shots, etc., can be done for their tonal effect without exceeding the dynamic envelope. Good engineers use #1 only when they have to, and #3 when the song, the playing style, and the mix call for it. #2 is usually used by clueless nimrods who call themselves "producers", and are more interested in making money than art. Dynamics are your friend, not your enemy, and not surprisingly, compression needs to be used more often on bad musicians than good ones.