When a charged cloud passes over the earth ,it induces equal and opposite charge on the earth below.
As the charge acquired by the cloud increases the potential between cloud and earth increases and therefore when the potential gradient exceeds 10 kv /cm there is breakdown of air insulation and a flow of charge called leader streamer starts from the cloud and reaches to earth.
When the leader streamer of negative charge touches the positive charge of the earth a huge spark takes place which causes a return streamer to reach towards cloud which appears as a lightning.