Because of the climate and the protection that the trees provide. Because rain forests are in tropical regions, they get a large amount of sunlight which helps the plants grow. These plants then feed the animals and help them thrive. The canopy-like structure gives animals places to hide and live.
Tropical rain forests are warm and wet, and the temperature does not vary much. Because of this, a huge variety of plants can live in tropical rain forests. Because there are so many kinds of plants, there are habitats for many different kinds of animals as well.