Lightning is a powerful and sudden discharge of electricity in the atmosphere. It occurs during thunderstorms when there is a buildup of electrical charge between clouds or between a cloud and the ground. As the storm clouds develop, positive and negative charges separate within the cloud. The top of the cloud becomes positively charged, and the bottom becomes negatively charged. When the difference in charge becomes large enough, the energy is released in the form of lightning.