Why should animals be kept in cages?

for various reasons they could be dangerous animals, or the cages could be used for discipline ,transportation , and many other things