If you can understand why your dog is escaping, you can usually find the answer. If your dog is bored, for instance, look at how you can enrich their environment so they want to stay in the yard. If they have a high prey drive and they're escaping to chase small animals, you have to give it a different job and work on some obedience and impulse control.