How does lightning work?
Much remains to be learned about lightning, but I try below to give the essentials...
Lightning starts with the accumulation of large amounts of charge in a thundercloud. This charge results from droplets of water being blown upwards through particles of ice in the higher layers of the cloud. The result is a buildup of positive charge high in the cloud, with negative charge in the lower portions.
Once the charge reaches a critical level (I'm not aware of whether this level has been reliably measured), electrons can cause ionization of molecules in the air, and a conducting path begins. The negative ions travel a short distance along this path, then stop and accumulate for a short while, before starting off again in a new direction. This process repeats over and over as the path of ionized air zig-zags its way toward the ground. This is not the lightning bolt at this stage, it is a leader that creates a path that the bolt will later follow.
Once the downward charge reaches a perhaps a hundred meters from the ground, the negative charge buildup begins to cause positive "streamers" to emerge from objects in the ground.
Check this video - shot in my hometown :)
It is the streamer that connects with the downward negative charge leader that "closes the switch" and completes an electric path that allows the charge to drain from the cloud above.
This image shows it well
Here is a great explanation from the Discovery Channel