Natural selection can only work on existing variation within a population. Such variations arise by mutation, a change in some part of the genetic code for a trait. Mutations arise by chance and without foresight for the potential advantage or disadvantage of the mutation.