Due to friction from winds, clouds MB each other and get electrically charged during a thunderstorm (bundles of small water droplets and ice particles form thunderstorm). The upper part of cloud is usually positive while the lower part of the cloud gets usually negatively charged.
Sudden movement in the cloud causes this electrical charge to discharge in the form of LIGHTNING (DAZZLING LIGHT).