Fences can be tricky. There are many types and many ways to circumvent them.
Fencing is like old castle walls. Interestingly, I once broke into an old castle by jumping over a small protective fence across a dry moat and scaling a small section of wall—breaking into a castle is relatively easy as long as people are not shooting arrows at you while you do it.
The point is, fences are fallible, as are all security measures. It's only when they are aligned with other security measures that they become a working security solution. Security is often seen as a black-and-white thing: something is secure or not secure. But it's more nuanced than that. Security provides a means to slow an attacker. On a long-enough timeline, an attacker will succeed at getting in. Fencing is the same; slow an attacker long enough that they will be caught.
I mentioned that there are many types of fencing: different materials, different heights, and even different methods of making them effective. Most can be bypassed in obvious and easy ways. Look at any fence for more than a few minutes, and I am sure you can figure out a way to cut, scale, or otherwise circumvent it.
People can add tricks and other security measures to a fence to make it feel more secure. For example, tremble devices let you know if the fence is being moved—the trouble is, foxes and other animals can set them off, too. You can have fancy toppers like razor or barbed wire or even glass—again, easy to overcome ...