Some individuals in a bacterial population have alleles that give them resistance to an antibiotic. The population is exposed to the antibiotic, killing the bacteria without the resistance allele. The resistant bacteria survive and reproduce without competition, passing on the allele that gives antibiotic resistance to their offspring. After some time, most organisms in the population will carry the antibiotic resistance allele.