For most any animal boredom will increase their escape attempts. An animal who isn't bored, doesn't try to escape as much.
Providing fun and entertainment might not 100% stop escape attempts, but it will dramatically decrease their attempts. There are always other drives that might cause escape attempts, like just seeing or smelling some tasty plant on the other side they decide they want. Or a curious animal who just wants to know what is happening outside. Even a desire to come find you and get affection might motivate an escape.
Providing stuff to climb can be essential to goat happiness. Not just stumps, but some sort of goat jungle gym. Narrow walk ways leading to higher positions always seem to please goats.
spools are a common goat play ground
Or more natural version, just a tree that has low enough access for them to get up
or in between stumps and logs arranged to create a challenging course for the goats to play on.
"Where will you drive your own picket stake? Where will you choose to make your stand? Give me a threshold, a specific point at which you will finally stop running, at which you will finally fight back." (Derrick Jensen)