Lightning happens when electrical charge builds up in a storm and then discharges suddenly. The discharge can happen inside a cloud, between clouds, or between a cloud and the ground.
Why storms build charge
Inside storm clouds, moving air, water droplets, ice particles, and collisions help separate electrical charges. When the difference becomes large enough, lightning can form a path through the air.
Lightning and thunder
The bright flash is lightning. The sound that follows is thunder, caused by air rapidly expanding after being heated by the lightning channel.
Lightning is one of the most dramatic examples of electricity in nature.