There is another factor beyond adaptation (evolution) which does not involve a permanent change in the genes within the DNA. Certain genes have the ability to be turned on and off (or upregulated or downregulated) based on biochemical modifications like methylation that can occur in response to environmental exposures. This process is called epigenetics and modifications can be passed down to offspring (but often at least partially reset in the next generation). For example, in humans, starvation in a grandparent affects children's, and grandchildren's mortality in males. This control of certain genes is also a product of evolution. Offspring with this flexibility to upregulate or downregulate a gene can adapt to a fluctuating environment such as plentiful or scarce food, and thus are more likely to pass this trait on to their offspring. Cool stuff!

https://www.nature.com/articles/s41467-018-07617-9