When conserving food in jar, why is the jar turned on its head when cooling? I am talking about the process, where you cook food, for example, a vegetable and conserve it in a jar. The jar can then be stored in a non-refrigerated area. 

Many recipes include adding salt, vinegar or some other preservative to the jar. 

The process I am talking about only uses water and heat.

I am trying to do this for a third year, each time I have multiple jars going bad.

Most tutorials include the filled jar being heated up (in a water bath) and then (or even while heating) being turned on its head and being let to cool in this position until it is ready to be stored away.

Most tutorials mention, that there is a vacuum being formed, and the jar being on its head somehow helps the process.

It looks something like this:



The way I understand it is that during the heating process the air in the jar expands and escapes the jar, which reduces the air.

What I don't understand is why this is necessary, obviously there is no perfect vacuum and why the jar needs to be turned on its head?

Also, since the jar is cooked and all bacteria killed, why is air a problem?
Generally turning a jar upside down after filling is a alternative to a proper hot-water bath, not an addition to it.  This is known as the inversion method, and is used by many cooks of jams, jellies, mustards, and other very-low-risk canned foods.

The idea of inversion canning is that, by forcing the air in the jar through the hot liquid, you can kill and bacteria in the air (and on the inside of the lid).  It is not considered safe by experts, because there are numerous ways that bacteria can survive the process.

If you are doing "proper" canning, that is heating up the lidded jar to 85C or above, the sealing, inverting the jars is in fact a bad idea as it could result in liquid preventing the jar lid from sealing properly. The Ball jar corporation says “Do not invert. move or store jars while cooling, as this may cause seal failure.” At the least, it's unnecessary.