Dynamic range compression in mastering is used to control the dynamic variations in a mix, making softer elements more audible while preventing excessive peaks, resulting in a more balanced and controlled sound.