Mutation creates new genetic variants that natural selection can act on. A mutation is a change in an organism’s DNA sequence, and some mutations can be inherited when they occur in germ cells or their precursors.
Mutations can result from copying errors, chemical changes, radiation, or other forms of DNA damage. Their effects vary: some have no noticeable effect, some are harmful, and some can improve survival or reproduction in a particular environment. Natural selection changes the frequency of variants; mutation introduces new variants.
Mutation is not directed toward what an organism needs. Environmental conditions can favor existing mutations, but they do not generally cause organisms to produce useful changes deliberately. Other evolutionary processes, including recombination, gene flow, genetic drift, and selection, also shape genetic variation in populations.