Earth and clouds are oppositely charged due to induction. When a large amount of charge is accumulated between them, ionization of air takes place which leads to lighting.
The stepped leader originates from the cloud with a negative charge and positive streamer originates from the ground with a positive charge.