Through adaption. Adaption is a process in which an animal develops characteristics better suited for the environment it lives in.
Example:
Animals that live in deserts and arid climates consume less water and have developed to store it.
Hope it helped!