Environmental effects don’t cause changes in DNA, that happens by random mutations. Evolution “by natural selection” acts at a later stage. Evolution works through any mutation that affects the probability of an individual with it successfully reproducing. If it renders the bearer sterile then the mutation won’t make it to the next generation. If it makes the bearer successfully produce twins from every fertilised egg then the mutated form will appear in twice as many offspring as the unmutated form and will spread through the entire population in a few generations. In the real world most mutations are harmful and die out quickly.
But over time the mutations that make an individual better able to rear offspring to the point where they can reproduce will tend to spread through the entire population. Sometimes the mutation will favour individuals in a particular location, perhaps because it aids feeding on a particular local foodstuff. In that situation individuals in one area might develop different mutations to those in a different area. This could lead to speciation.