The IGBTs inside a VFD switch the output voltage on each phase quickly between the + and - DC bus voltages in order to create a PWM (pulse width modulated) voltage waveform that will approximate the desired sinusoidal output after some form of lowpass filtering. To a large extent, the inductance of motor windings will perform such lowpass filtering because the
current through an inductor is the time integral of the voltage across it, and the magnetic field (and therefore the torque) which the windings produce is proportional to this
current (and not directly to the voltage itself). But the PWM voltage waveforms at the VFD output will contain a high level of distortion not only at harmonics of the desired output, but also at other frequencies related to combination of these harmonics and the carrier frequency of the PWM. The bottom line is that measurements of THD on the VFD output voltages would not be particularly meaningful, but they would be expected to be very high.
Although a motor can operate directly on a VFD output, the fast rising and falling edges of the output voltages can cause undesireable issues such as reflections on cables to the motor which result in excessive voltage spikes that can damage motor windings as Ron has said. This becomes more problematic as the length of the cables increases. And so load reactors or filters close to the VFD output are sometimes used reduce the higher frequency content of the PWM output. There are others on this forum that have much more practical experience than me in addressing such issues in the field, for example
@Jraef.