How does electric discharge in lightning occur if air is a bad conductor of electricity?
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 no longer able to resist their flow.