Ex Situ Conservation
Although the goal is to keep species in the wild where they belong, sadly this is not always a viable option for many rare and endangered species, especially as human activities increase. The population may be too low, and/or the threats to its survival too great.
Ex situ, or off-site, conservation means removing species from the wild and keeping them in captivity. Facilities include zoos and aquariums for animals, and botanic gardens for plants.
Captive breeding has been the saviour of many animals, such as Père David's deer and Przewalski's horse - species that went extinct in the wild but survived in captive colonies. Zoos can help educate the public and encourage their support of conservation projects, and research on captive animals can better inform wild animal conservation. Conservation generally works well when both ex situ and in situ practices are used together, and captive bred animals can be returned to the wild.
However, I personally dislike zoos. I believe keeping animals effectively in prison for our amusement is wrong, and how educational they really are is up for debate. Good zoos may do good work, but there are far too many bad zoos. This is a subject many conservationists feel conflicted about.