Genetic drift is a by chance change in the frequencies of gene in a particular population. For example let us say that the allele for green hair has a frequency of 2 percent in a population of 500,000. Therefore, 100,000 alleles for this trait would be present in the gene pool. If the population were small, let suppose 100, only two green hair alleles would be available. And if by chance both of the individuals died or were of the same gender or lived far apart that they never met. Then the green hair allele would be lost from the gene pool.
Organisms can move from one population to another taking their genetic makeup along with them. This process is called gene flow. This can alter the frequency of alleles in the gene pool of both the population left behind and the new population just joined.
In nature, one group of organisms of a specific species is often isolated from another group of the same species. Isolated species are known as demes. For example a population of starfish in one pond may be isolated from a population of starfish in another pond. By chance if there occur a heavy flooding, the two ponds may be connected. Then the organisms from one pond may lose to the other pond. This phenomenon can affect the gene pool, changing the frequency of alleles in both groups.
Another factor that can randomly alter the frequency of alleles in the gene pool of population is mutation. Mutations are the permanent changes in the genotype that can be inherited by offspring. Such changes do not cause evolution, but they do introduce variation within the gene pool.
Natural selection is the process by which the best adapted individuals produce the most offspring, which in turn carry forward to their offspring the genes that gave their parents the upper edge.