First thing to realise is that most animals held in captivity today were born there and not in the wild. So they know nothing about the wild.
In the wild they need a territory to supply food, water and companionship. In an area rich in food the territory will be small. One lacking food will be larger.
In a zoo the 'territory' can be that much smaller as (well in a GOOD zoo) all requirements are provided.
The wild is a a dangerous place, full of stresses, dangers and disease and the wild grows smaller every second of every day.
In spite of the horrors of the wild the animals in zoos should be there but in the present state of play on our planet zoo animals are better off where they are,