Lightning is a phenomenon observed due to atmospheric electricity where a bright streak of light accompanied by a thundering sound is observed due to jumping of charge from one cloud to another or from a cloud to the earth surface.
As water vapors evaporate it is carried by air, this involves friction of vapor particles and development of static electricity. When large cloud mass accumulate, enormous amount of electric charge gets stored on it. When this accumulation of charge exceeds that of the electric capacity of the clouds and air, a spark jumps from a cloud of higher potential to clouds of lower potential. If no lower potential clouds are found, the clouds transfers excess electricity to earth. We call this spark lightning.