My guess is to act as a snubber for the neon, which my vague guess is being used to clamp the voltage on the output. Also (second probably better guess), the electric fence acts like a unloaded transmission line which exhibts a very inductive load to the transformer, in fact the ferranti effect can cause the output voltage of the transformer to rise above its EMF value, causing it to ferroresonate and bad things generally occuring. The capacitor balances out the inductiveness of the line causing the transformer to see a more "real" load.