Lightning is caused by an electric current inside a thundercloud that connects with the ground beneath the cloud. Lightning occurs when tiny pieces of ice start bumping into one another as they travel through the air. The collisions of ice generate an electric charge inside the cloud.
Inside the cloud, there is a positive charge that forms near the top of the cloud and a negative charge that forms on the bottom. There is also a charge that builds up on the ground below the cloud. This charge concentrates on any object that sticks up, such people, poles, buildings and mountains. The charge from inside the cloud and the charge from the ground connect to create a lightning strike.