When bacteria divide, random mutations in their DNA lead to differences in bacteria. Some of the bacteria will randomly develop genes that help them to survive a dose of anitbiotics (resistance). When a person is treated by antibiotics, all the bacteria without resistance will die but the bacteria with resistant genes will survive. The resistant bacteria can then reproduce very effectively due to decreased competition, creating a now drug resistant group of bacteria.