Question: I'm a mechanical engineer so I don't know much about electric circuits and power generation to begin with. Can somebody explain what a harmonic is in the power grid and what is the reason why it is bad? I understand it comes from non-linear electric loads but what does that mean?

Answer: 
A particular reason why the electricity companies think harmonics are bad is that they have to supply them (which means a generally slightly thicker cable on average) AND they can't usually bill the user for them. There are exceptions of course (for higher energy users) and they are encouraged (by the cost of their bill) to keep harmonics low and power factor as close to unity as possible.

A harmonic is a term that nearly always applies to a non-linear load distorting the normally sineusoidal load current. Basically it's not a higher power consumption but it does mean the infrastructure has to be able to cope with the basic billable currents and the generally non-billable harmonics: -

[![enter image description here](https://i.stack.imgur.com/lJvhY.png)](https://i.stack.imgur.com/lJvhY.png)
The following may help understand non-linear loads and how they generate harmonics.

![schematic](https://i.stack.imgur.com/rhzSX.png)

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2frhzSX.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)

[![enter image description here](https://i.stack.imgur.com/dIkNs.gif)](https://i.stack.imgur.com/dIkNs.gif)

*Figure 1. A simple bridge rectifier, smoothing capacitor and resistive load.*

The circuit of Figure 1 should be easy enough to understand. When the top AC input is positive current flows through D2, R1 and D3 back to the other AC line. C1 charges up and maintains voltage on the load. For a mechanical engineer this would be analogous to having two pulsed hydraulic supplies, four non-return valves (D1 - 4), a pressure reservoir (C1) and the load (R1).

Form the above it should be seen that current (flow) on the first pulse will follow the supply pressure but that on subsequent pulses no current will flow until the reservoir pressure is exceeded by the supply pressure. The result is that the required current flows in pulses - see the black curves in Figure 2. 

*Figure 2. Rectified AC (red), capacitor voltage (blue) and rectifier current (black). The AC current (to the left of the rectifier on Figure 1) will look similar to the black curve except that each half cycle will alternate above and below the line.*

It should also be intuitive that since the rectifier provides current in pulses that the peak current may be many times the average current.

Since any periodic wave can be formed by the addition of a sine wave of the fundamental frequency and its harmonics (in varying amounts) the distorted current demand creates harmonics in the current supply.

[![enter image description here](https://i.stack.imgur.com/27HVo.gif)](https://i.stack.imgur.com/27HVo.gif)

*Figure 3. This fabulous illustration of the Fourier Transform by Lucas V. Barbosa on Wikipedia's [Fourier transform](https://en.wikipedia.org/wiki/Fourier_transform) page shows the transformation of a periodic waveform from the time domain to the frequency domain. The frequency plot shows the relative strength of the harmonics with clarity that could not be obtained from staring at the time plot.*