Clouds having water droplets, coming from different directions, strike each other and due to striking, a friction force is created when they rub each other and during rubbing, the charges appear on clouds (static charges).
They grow in number due to continuous charging and finally discharge when any region of moisture is found on the earth because they get the path of discharge due to this place.