During a thunderstorm ,due to strong winds ,clouds rub against each other and produce large amounts of static charge.Most lightning occurs when static charges discharge within or between clouds.A huge negative charge builds up at the bottom of a cloud,which attracts positive charges on the Earth's surface.\thus, a rapid static discharge occurs from the cloud to the Earth's surface.It is called lightning.