The answer is genetic drift and genetic shift. The former occurs when small changes occur in the genotype of a population that accumulates over time and changes the allelic frequency of the population. The latter (genetic shift) occurs abruptly and is usually caused by a bottleneck effect.