Thunder is the sound caused when lightning, a huge discharge of electricity during a thunderstorm, shoots through the air. When lightning strikes, a large amount of electricity travels through the air, causing the air to heat up rapidly and expand, resulting in thunder. The safest place during a thunderstorm is indoors or inside a car with the windows up.