The relationship between animals and the selection pressures of their environments can be outrageously complex. All creatures on the planet today are the result of millions and millions of years of these interactions—generation after generation of natural selection for traits/genes just a little bit more fit for each population’s unique and changing environment. Yet, for each species and each adaptation, the underlying mechanism is the same:
In response to selection pressure, the frequency of traits and the genes controlling those traits changes in a population over time. That’s evolution.