Some cats can be taught to stay in an enclosed back yard. It worked for me the one and only time I tried it. Back in the days I could easily hop over a chain link fence, that is.

It only took 2 times. The cat jumped the fence, and I jumped the fence, caught the cat and threw her back into the yard. After that, the cat never left the yard.