Why is the shape of the lightning (or an electric spark) always of a zig-zag nature? Why is it never just a straight line?
Why is it never just a straight line?
I think it can be interesting to answer both questions and add a few interesting details to the answer already given.
The zig-zag line is a sort of optical illusion, if you watch the slow motion of a ligtning on YT here at 3:04 or here from 0.45 to 0.51, you will see that the real path looks like the course of a river. Each discharge is a series of steps in which the current travels a short distance and then pauses: each pause is where we see a change in direction. Meanwhile the local potential to ground is changing, so the final target is constantly changing.
As the discharge approaches the earth, many potential targets might be seen, but only one or a few will ionize the local air enough to provide the final path to ground, a small discharge can be seen coming from objects that were failed targets, and there is upward lightning. That explains also why the zig-zag line is not perpendicular to the ground.
You can compare the actual course of the lightning in the above picture 10.3 with the picture you get with an ordinary camera or with the eye:
The secondary branches are only temporary and in different directions, but they remain impressed on the retina at the real flow of time.
The lightning is just electricity, a huge burst of electrons that try to find the path of least resistance through the molecules of the atmosphere to the ground.
The electrons come from many different places in the clouds and the atmosphere is not homogeneous: there are differences in humidity, temperature, density, particle count, velocity, etc., and this is particularly true in thunderstorms. Charges build up all over the place and electric fields exist all over as well, sooner or later one or more of these electric fields reach critical strength, or perhaps a cosmic ray ionizes a path through the middle of it where things start to conduct and there it goes: lightning and thunder.
While moving electrons are subject to change of direction from magnetic fields. The energy is coming from differences in statics voltage levels or electric fields
The electric arc forms where the air is most easily ionized (which is what makes it conduct electricity) and generally in the direction of shortest distance between the electrical charge and the ground (the electrically lower potential).
The lighting shape and path is a non-linear phenomenon. Why? Because it involves a multitude of interactions with the medium (air molecules, atmosphere) and these depending on range of interecations are also non-linear. However there are compatibility conditions (or conserved quantities), as such this is a good example of the fractal geometry of nature.