Audio sampling (time data) is converted to a frequency spectrum using FFT (Fast Fourier Transform). Since the reference contains only the background noise while the rest of the clip contains noise + audio to clean up, you get separate frequencies so you can subtract them to get the clean audio only. Set the Denoise Power dial in dB and choose the number of reference samples.
For example, if you record a voice with a microphone3:
This has the effect of creating a keyframe that marks the beginning of the reference range, mentioned in point 1, which in our example ends at 65536 samples later.
During playback, the background noise is then automatically removed along the entire length of the effect.