During thunderstorms, static electricity builds up within the clouds. A positive charge builds in the upper part of the cloud, while a large negative charge builds in the lower portion. When the difference between the positive and negative charges becomes great, the electrical charge jumps from one area to another, creating a lightning bolt.
Most lightning bolts strike from one cloud to another, but they also can strike the ground.
These bolts occur when positive charges build up on the ground. The hailstones bump into water droplets within the cloud, each time gaining a negative charge. At the same time, small particles of ice form from water droplets as they freeze, carrying a positive charge as they move to the higher parts of the cloud with the rising air currents. So, the positively charged particles are collected at the top, and the negatively charged particles are at the bottom. The negative charge in the base of the cloud causes the Earth to have a positive charge.