When reducing bit depth (for example, from 24-bit to 16-bit), quantisation errors can create distortion or harshness in quiet passages. Dithering combats this by adding controlled random noise to smooth the transition between quantisation levels, masking distortion and maintaining perceived fidelity.
Noise shaping refines this process further by redistributing the dither noise into less audible frequency ranges, improving the signal-to-noise ratio in the most sensitive parts of the spectrum. This technique is routinely used during digital mastering and file export to maintain the best possible sound quality in CD or streaming formats.