To enhance the sonic quality of a musical composition (or a rendered mix) before its commercial release on DSPs, a music mastering engineer employs various techniques based on their years of experience (this includes time spent assisting other audio mastering engineers) and acoustical training as already mentioned by Wynter such as stereo or mid/side equalization, dynamics processing (compression and limiting), saturation, gain maximization (
soft clipping), and dithering or noise shaping; these processes are performed using specialized
audio software, digital signal processors, analog hardware or all of them combined in a hybrid system.
These well-informed adjustments make sure that recordings are accurately presented on any device they may be played back on while being consistent in terms of level and dynamic range, making listening enjoyable across different hi-fi speakers (don't forget those bookshelf
grot boxes too) and headphones.