Lightning transfers electrons from the atmosphere to Earth.
Electrons build up in clouds because wind causes them to rub
together (Charging by friction).
The negative charges in the clouds push the negative charges in the ground away leaving positive charges on the surface (Charging by induction).
Once enough negative charge builds up in a cloud, it repels so strongly (second Law of
Electric Charges) that it jumps through the air (an insulator) and strikes the positively
charged ground or the nearest object (first Law of Electric Charges).
This figure shows how a lightning rod can protect a house from a lightning strike.
A metal rod is attached to the highest part of the building. A conductor is connected from the metal rod to a metal plate in the ground.
If lightning strikes the rod, the conductor carries the negative charges safely into the ground.