Harmonics are unwanted higher frequencies which superimposed on the fundamental waveform creating a distorted wave pattern.
Harmonics are created by an electrical or electronic device or circuit that has a voltagecurrent characteristic which is not linear. I.e., the output voltage is not proportional to the input voltage.
Harmonics due to clipping
Denote the original unclipped signal as , the clipped signal is . While the original signal has only one frequency component f, the clipped signal will have higher order harmonics with frequency components of n·f.
 Typically, clipping is symmetric in both positive and negative directions, i.e., . Symmetric clipping generates odd harmonics with n = {3, 5, 7, ...}.
 An asymmetric clipping generates both even and odd harmonics with n = {0, 2, 3, 4, 5, ...}.
Time domain  Frequency domain  

original signal:
 
Clipped signal:

Harmonics due to nonlinear power amplifier (PA)
A power amplifier is linear if its output voltage is simply a constant times the input voltage:
But in reality they have nonlinearities that make the output voltage a function of higher order terms of the input voltage. The output voltage for such nonlinear amplfier can be expressed as a Taylor series: . In addition, power amplifier may also clip the input signal.
Below shows the impact of a nonlinear power amplifier to the input signal.
Toolbox: harmonics due to nonlinear power amplifierTime domain  Frequency domain  

Input signal:
 
Output signal:
