A habitat is the natural environment in which an organism lives.
Many animals have adapted to their environment over millions of years, allowing them to survive with relative ease in almost any situation.
However, many animals are also able to adapt very quickly, some with remarkable alacrity, to sudden changes in their environment, where others simply die out in similar circumstances. Compare for example Pandas and Pigeons, the former's habitat must be very specific to avoid extinction and the latter can live pretty much anywhere - simply moving on to new pastures if their situation becomes undesirable.
Since life began on Earth, animals have evolved to survive in an enormous variety of habitats:
The ability of animals to adapt to life in many different habitats has allowed animal life to continue to survive on Earth as the structure and environment of our planet has changed over billions of years.