As the heatwave that has baked Europe over the last few weeks starts to ease, meteorologists are predicting huge thunderstorms. But why does hot weather always seem to lead to thunder and lightning? And what causes lightning?

Well, the answer requires some knowledge of fairly basic physics. The first, and most important thing to remember, is that hot air rises.

As the hot air rises, it cools and begins to condense forming tiny droplets of water. If the air is warm enough and there’s enough atmospheric instability, the warm air rises very rapidly. If this happens quickly enough it can form a cumulonimbus cloud. These are the clouds that appear very rapidly on days which have otherwise been cloudless. It often takes less than half an hour for a cumulonimbus cloud to form.

If the hot air rises slowly, the water droplets simply become rain and shower back down. However, when that warm air rises even higher (for example, when a cold front slides in underneath and pushes it upwards) the water droplets freeze and become ice crystals. Large ice crystals can fall as hail, but smaller one can stay aloft in the cloud.

The ice crystals bash into other ice crystals in the cloud. The big crystals can steal electrons from the smaller ones. Electrons are negatively charged, which upsets the balance of the ice particles. The bigger ones become saturated with electrons, giving them a negative charge, while the smaller ones have lost their electrons and are left with a positive charge.

The negatively charged ice ends up near the bottom of the cloud. Meanwhile, the positively charged crystals are at the top. At this point, one of two things can happen.

The first option is that the positively and negatively charged electrons within the cloud attract one another. They will rush towards one another and smash together creating a lightning flash within the cloud.

However, the other (more dangerous, for us ground-dwellers) option is that as the negative charge at the bottom of the cloud builds up, the negative electrons on the ground are repelled. That’s the same way if you hold two negative ends of a magnet together, they’ll repel each other. That means the ground under the cloud becomes positively charged. Just as above, the positive electrons in the ground attract the negative electrons in the ground. However, as the ground can’t come to the cloud, the cloud must go to the ground. This results in a lightning strike where the electricity hits the ground.

When positively and negatively charged particles smash together to form lightning they release a huge amount of energy. This is released as light and heat energy. The light energy is what we see as lightning. The heat causes the air to rapidly expand, causing a clap of thunder.

And this is why hot weather causes thunder and lightning.