This gives protection to the transformer, be it a NST (Neon Transformer) or a PIG from any 'over voltage' situation that may occur. This is when a reverse EMF is generated by the primary and heads back to the coil. This situation can also arise if the primary receives a strike from a streamer from the top load.
With NST's it is also advised to have a 'Terry Filter' as additional protection. The NST is one of the costlier and also fragile parts, so it is important to safeguard it.
The wiring is shown below, with the gaps being adjusted so that they only occasionally 'fire' when running with everything disconnected. This ensures if the voltage climbs above normal they will then fire, shorting out the incoming high voltage spike. Obviously this shorts the NST output as well, but NST's are built to withstand a short circuit across their output. This is because a neon tube initially presents a short circuit to its NST when it first starts up.

Here you can see the safety gap (circled in yellow) is firing as a result of a strike to Primary.
Underneath the safety gap you can also see the normal spark gap in operation as well. This was the original arrangement I had before I moved the spark gap to inside the base box (as can be seen here).

NST's usually consist of two opposite wound coils with their ends joined to form a centre tapping. A 10,000 volt NST consisting of two 5,000 volt coils, a 15,000 volt one would be two 7,500 volt coils etc. This way the voltage across each coil is reduced, this in turn bringing down construction cost by way of lower insulation requirements.
As you can see in the main top picture I went overboard somewhat on the construction of this. Three spaced nails in a piece of wood would work just as well. I had recently purchased a knurling tool and a spherical turning attachment for my lathe, so this seemed like a good excuse to try them out.
If you have a Variac that is capable of giving out a slightly higher voltage than the input (most will) then a good way to adjust the safety gap is as follows. Set the Variac so its output voltage to the NST is the normal mains voltage that the NST is designed for. At this setting the safety gap should not be firing. Then increase the Variac's output voltage to the NST a little and the gap should now fire regularly. In the UK (235 volts ~ ) the NST steps up the voltage by a factor of 42 approx' for a 10Kv NST. So a 12 volt increase to the NST's primary winding will give nearly 500 volts of over-voltage on the secondary, so don't go too mad with the voltage control!