Thunder and lightning is a fascinating phenomenon fuelled by the interaction of subatomic particles. But let’s keep it simple. Thunderstorms begin their lives in cumulonimbus clouds. These clouds are formed from water vapour carried on rising air currents, often reaching an altitude of about six kilometres (20,000 ft). At this height the air is colder than it is at sea level. Drops of water, hailstones and specks of ice form and collide with each other. This is where the magic begins.
An electrical charge is created within the cloud. The top of the cloud takes on a positive charge as protons rise, while electrons descend to the bottom of the cloud. The negative electrical charge at the bottom of a cloud creates a positive charge in the ground underneath it. As the negative charge gets stronger, the air cannot stop it from jumping from the cloud towards the positive charge on the ground.
The result is a giant spark of electricity, also known as lightning.
Thunder is the product of lightning. The temperature of a lightning bolt reaches up to 30,000 C (54,000 F), or about six times hotter than the surface of the sun. The bolt heats the air around it causing it to expand and then contract. The result is a shockwave that you hear as thunder.
Short answer: Lightning is a flash of light created by electric discharge. Thunder is a soundwave created by the rapid expanison and contraction of air.