Electric current (AMPS) only flows when a circuit is completed between a positive and negative terminal.
In this diagram the current cannot flow from the positive terminal to the negative terminal because the switch is open.
In this second diagram, the switch is now closed, allowing the current to flow from the positive terminal through the light bulb (lighting the bulb) to the negative terminal.
An electric fence circuit is made on a larger scale. The energizer fence terminal (positive) is connected to the insulated fence wires, and the energizer earth terminal (negative) is connected to galvanized metal stakes driven into the ground.
The same 'circuit completion' (second diagram above) is necessary before the animal gets a shock. An animal standing on the ground and touching the electrified wires (shown right) will complete the circuit like the closed switch in the second diagram above.
For example, a bird sitting on the wire will not receive a shock (shown left). It is not touching the ground so the circuit is not completed. A person wearing insulated footwear will only receive a small shock because all the current cannot pass through the insulated soles.
Dry, sandy or pumice soil is a poor conductor of electric current, so it is a good idea to add an ground (negative) wire into the fence. The animal must touch both a hot wire and ground wire to feel an effective shock.