An electric fence system works by sending a brief, high-voltage electrical pulse through wires at regular intervals. When an animal or person touches the wire, they complete the electrical circuit between the fence and the ground, receiving a short, sharp shock. This acts as a psychological barrier that deters animals from trying to cross the boundary established by the fence.