Going to branch off a bit here to the extent that genetics enters the picture and most people have an out of date concept of the subject, which is to say most imagine DNA as a static template or blueprint, with adaptations waiting for and dependent on randomly fortuitous dna transcription errors to favorably alter some characteristic of an organism. In fact, what's emerged from the science of recent decades is that DNA works more like software... you can easily research this for yourself.
Without writing a science paper here or a software course, this basically means some species are genetically 'programmed' to respond to certain environmental triggers in predictable ways. A reference below (study of stickleback fish) as to how this can play out in the real world:
https://med.stanford.edu/news/all-n...-on-evolution-from-study-of-sticklebacks.html
The scientists found that the animals — despite their different haunts — repeatedly developed the same traits through changes in similar regions of their genomes. Specifically, the researchers identified 147 regions that varied consistently among freshwater and marine sticklebacks. About 80 percent of the changes involved regulatory regions of the genome that control when, where and how genes are expressed.
“This addresses a classic debate in evolutionary biology,” said professor of developmental biology
David Kingsley, PhD, the study’s senior author. “How do new traits evolve in natural populations? Do they arise through mutations in the coding regions of genes, which alter the structure and function of encoded proteins? Or are new traits the result of modifications in the regulatory regions of genes, which control where and when already-established proteins are expressed?”
“The threespine stickleback has evolved like many other animals,” said Kingsley. “But they’ve done it recently enough that they are ideally suited for study. The fact that they’ve evolved the same traits over and over again allowed us to search for those genes that control adaptation to marine or freshwater environments.”
To understand this, it's important to note that certain traits appear
repeatedly or can switch back and forth, depending on the environment, and that this switching is not random or accidental, but is
controlled by specific genes.
One version of the old model would be that a small number of individuals might already exist with a mutation for an adaptive trait and the new environment favors this trait, which is more successful in the new environment and gradually replaces the standard characteristic in the new population. This might take thousands or millions of years... or perhaps the species dies out, still waiting on such a fortuitous mutation. The new model, which has become evident with the advent of gene mapping, is that species can switch certain traits off or on in response to environmental signals. In very simplistic terms, this might be analogous to your car turning the radiator fan off or on, or its ECU adjusting fuel injection or valve timing according to various sensor inputs.
In a fish species, this could affect color, finnage, scale counts, mouth structure, intestinal length and other characteristics and, depending on the adaptation, might take place within a few generations or even during the lifetime of the individual fish. Another cichlid example would be Malawi cichlids, the current diversity potentially originating as recently as the mid 1800s.
Link