How charge builds up in clouds
Inside a thunderstorm cloud, water droplets and ice particles bump into each other as they move around. When these particles collide, electrons are knocked loose from some particles and stick to others. This creates a separation of electrical charge. Lighter ice particles at the top of the cloud become positively charged, while heavier particles at the bottom become negatively charged. As more collisions happen, the charge difference keeps growing stronger and stronger.
When the charge becomes too strong
Eventually, the electrical difference between the cloud top and cloud bottom becomes so large that the air between them can no longer insulate them from each other. The negative charge at the bottom of the cloud starts to build up so much that it repels electrons in the ground below, making the ground positively charged. When the voltage gets high enough, it breaks through the air and creates a conducting path of plasma, which is ionized gas that allows electricity to flow.
The lightning strike
The lightning strike happens in stages. First, a step leader of negative charge moves down from the cloud toward the ground in steps. When it gets close to the ground, a streamer of positive charge moves upward to meet it. When they connect, a return stroke travels up the lightning channel and creates the bright flash we see. In many lightning strikes, multiple return strokes can travel up the same channel, making the lightning flicker.
Types of lightning
While cloud-to-ground lightning is the most famous and dangerous type, it only makes up about 25 percent of lightning strikes. Most lightning actually occurs within clouds or between clouds. Cloud-to-cloud lightning and intra-cloud lightning (lightning within a single cloud) are more common but we see them less clearly because they happen inside or between clouds.
Thunder and safety
Thunder is the sound created by lightning. The lightning channel heats the air so quickly to extreme temperatures that the air explodes outward, creating a shock wave we hear as thunder. You see lightning before you hear thunder because light travels much faster than sound. If you count the seconds between the flash and the thunder and divide by 5, you can estimate how many miles away the lightning is.