How do plants and animals survive in their habitats?