The traditional THD(+N) meter is a high purity sine wave oscillator with a tuned notch filter that rejects the oscillator tone. Any harmonics generated by the DUT will pass the filter. The resulting signal goes through some type of level detector. The performance of the meter is determined by the spectral purity of the oscillator and the depth of the notch. You can also use bandbass filters to isolate individual harmonics, but normally THD is what you care about.
A modern version would digitize the output of the notch filter and use an FFT to identify the relative harmonic strengths as well as improve rejection of the input tone.