Captivity is the condition of being trapped or confined. Animals that are kept in zoos are in captivity.
A prisoner is in captivity, and a kidnapping victim is also in captivity. If you catch a firefly and keep it in a jar, its life will be one of captivity until you let it go. When you're imprisoned or enslaved, you're captive. Both words come from a Latin source, captivus, "caught" or "taken prisoner," from the root capere, "to take, hold, or seize."