The death of Harambe the gorilla at Cincinnati Zoo, shot to protect a child who had fallen into his cage, has caused outrage. Some of the anger has now turned from “trigger-happy” staff towards zoos in general. Why, some are asking, is an endangered gorilla behind bars in the first place?

In an ideal world, Harambe would live peacefully in Central Africa. There would be no deforestation, no poachers, and no diseases transmitted by humans and our livestock.

But in the real world, fewer than 900 mountain gorillas are left in the wild. And zoos are a necessary and vital part of efforts to conserve them and other endangered animals.

Modern zoos aim to promote animal conservation, educate people, and support further wildlife research. The three are entwined to ensure the animals are housed to the highest possible standards of welfare. Staff are dedicated to providing species-specific housing, appropriate diets and husbandry to ensure that the animals’ lives are as natural as possible within captivity.

Anti-zoo and animal rights groups such as CAPS, PETA or the Born Free foundation claim that zoos are inherently cruel. They highlight animals housed in small cages for “our entertainment” and claim all should be released back into the wild.

But zoo design has moved a long way since the bad days of bare, concrete cages, and indeed innovative enclosures these days can closely replicate an animal’s wild habitats.

In fact, most zoo animals, including Harambe the gorilla, have been born and bred in captivity. They have never experienced “the wild”, which many people assume is a wonderful and safe place, despite destruction of natural habitats for palm oil, threats from climate change or the increase in poaching.

Two ways capturing animals helps conserve them

Zoo conservation work can be “in-situ”, where money, expertise and sometimes staff are provided to protect animals and their habitats in the wild.

Large, charismatic animals such as pandas, tigers or elephants draw the crowds. These flagship species help to raise the profile and funds for in-situ conservation efforts for the not so well known species. For example, there aren’t many visitors who would be passionate about protecting frogs or other amphibians yet zoos have been instrumental in preventing the loss of a large part of the world’s frog fauna.

“Ex-situ” conservation, meanwhile, takes place outside of the animals’ natural habitats, usually back at the zoo and often involving international captive breeding programmes. These studbooks can outline suitable genetic matches for breeding, to maintain a sustainable captive population of a certain species and ensure genetic variation.

Species such as the golden lion tamarin, Arabian oryx, Przewalski’s horse, the European bison, and even the common dormouse have at some point been reliant upon captive breeding so as not to become as dead as the Dodo.

Education & research

In the UK at least, zoos must have a written education strategy and an active education programme. If you have been to an accredited zoo recently you will have noticed they use games and technology to go way beyond these basic requirements.

Research within zoos often looks at animal behaviour or welfare, helping to ensure the animals are well housed and fed. Other research investigates the impact humans have on the zoo animals, from the visitor effect to the relationships which can be formed between the animals and their keepers. I recently investigated the human-animal relationship between zoo animals and the keepers.

Research also focuses on biological functioning of animals. Much of this is work that cannot be conducted in the wild if the animals live in remote or inhospitable areas. To take one recent example: Italian scientists who wanted to investigate the Vocal Repertoire of the African Penguin made recordings of a captive colony in a Turin zoo.

Overall, zoos provide opportunities to observe and engage with exotic animals, many of which may be threatened with extinction in the wild. Seeing them up close can spark a passion for biology, conservation and the environment.

So next time you decide to visit a zoo, take a deeper look at the animal care and information that is provided for you. You may become a defender of zoos and the vital work they do. But please: don’t enter their enclosures.

Samantha Ward, Lecturer Zoo Animal Biology, Nottingham Trent University

This article first appeared on The Conversation.