Lightning happens when the negative charges (electrons) in the bottom of the cloud are attracted to the positive charges (protons) in the ground.
The accumulation of electric charges has to be great enough to overcome the insulating properties of air.
When this happens, a stream of negative charges pours down towards a high point where positive charges have clustered due to the pull of the thunderhead.
The connection is made and the protons rush up to meet the electrons.
It is at that point we see lightning and hear thunder.
Each bolt has the potential to be as strong as a billion volts with temperatures as high as 54,000 degrees Fahrenheit.
Since a lightning bolt is so hot, it will superheat the air around it causing the air particles quickly expand and contract.
This happens so fast that a shock wave is created causing the sound we know as thunder.