Ig $v(t) = V_m cos(\omega t)$, then then because we have a non-linear impedance, $i(t) = \sum c_n cos(n \omega t + \phi_n)$. The cause of harmonics can be seen if we take a simple I-V curve that has clipping for the current. You can write the current as a power series (using Taylor's work), and from that you can see how it is the same as a Fourier series with harmonics caused by the clipping. The resulting waveform is periodic, but now has frequency components at $n\omega$. ").
In the linear load situation, $\bar V = V_m$ and $\bar I = V_m/(|Z|e^{j\theta})$ where $\theta$ is the angle of the impedance. Remember that the root mean square concept allowed you to say $$P=V_{rms} I_{rms} cos(\theta) =1/2V_m V_m/|Z| cos(-\theta) = Re[\mathbf S]$$ From Circuits you remember with the linear load, you have:
The complex power was $\mathbf S$. The magnitude of the complex power is the apparanent power,$S$.
$$|\mathbf S|=S=1/2V_m I_m = V_{rms} I_{rms}$$
$$P=1/2V_m I_m cos(\theta)=V_{rms} I_{rms} cos(\theta)$$
$$p.f. = cos(\theta) =1/2V_mI_m/S = P/S$$
For the non-linear load, we use the definition for the power factor: $$ p.f. = P/S$$
where $P$ is the power in the fundamental. Note that average power in other frequencies is zero. The voltage of the fundamental multiplied by the current of a harmonic aerages to zero, because $$\int_T cos(2\pi t/T) cos(2\pi n t/T + \phi_n) dt = 0$$
For example, ask Wolfram alpha, and get this: Thus the power in the harmonics is reactive power.
It is reflected back and forth between the source and load, and reduces the power factor. There is a more complete write up, see this.