Let us also be aware that the notion of "harmonics" (i.e., non-linear loads) is not the same as the notion of "power factor" (i.e., loads for which there is a phase shift between current and voltage).
In inductive loads, such as motors, and in capacitive loads, such as, well, capacitors, the peak value of current and the peak value of voltage do not take place at the same moment in time. One of the peaks takes place earlier than the other. The value of "power factor" is derived from the amount of time that separates the two (to be precise, it is the cosine of the phase angle between the two). But both curves, the voltage curve and the current curve, remain purely sinusoidal. Also, the amount of time between two successive voltage peaks is exactly the same as the amount of time between two successive current peaks. That is, whatever phase angle separates current from voltage, that phase angle remains the same from cycle to cycle (unless, of course, you do something silly like changing the amount of mechanical load that the motor is being called upon to support).
A motor is a linear load. So too is a capacitor bank. There are no harmonics associated with either. I am of course speaking in the purely hypothetical world of perfect equipment. If you supply power to the motor from a variable frequency drive, then the VFD will be a source of harmonics. But the motor will not.