How does electric discharge in lightning occur if air is a bad conductor?
Magnitude of accumulated charges in clouds is very high.
When the magnitude of the accumulated charges becomes very large, the air which is normally a poor conductor of electricity is unable to resist the flow. Thus, the charges pass through air.