Lightning is essentially a giant spark of static electricity, though much about how and why it forms remains unknown and the subject of scientific research. It is known that lightning occurs in thunderstorms when there is a separation of electrical charge within the storm clouds, which can cause cloud-to-cloud lightning, the majority of lightning that occurs in a storm.
A charge separation can also form between thunderstorm clouds and the ground, leading to classic cloud-to-ground lightning. Thunder is the acoustic shock wave that results from the heat that a lightning strike produces. NASA research suggests that lightning flashes 40 times a second around the globe.