Bacteria reproduce very quickly, so a population can change in a short time. Within a population of bacteria there is variation. A mutation can produce a new allele that makes one bacterium resistant to an antibiotic, so the antibiotic cannot kill it.
When a patient takes the antibiotic, it kills most of the bacteria, but the resistant bacterium survives. It faces less competition, so it reproduces and passes the resistance allele to its offspring. If one bacterium divides every 20 minutes, there are 2 after 20 minutes, 4 after 40 minutes and 8 after 60 minutes. Soon most of the population is resistant and the antibiotic no longer works.
This is natural selection happening in a short time, so it supports Darwin's theory. The antibiotic is the selection pressure and the resistant bacteria are the best adapted. MRSA is a bacterium that is resistant to many antibiotics. To slow the spread of resistance, doctors avoid prescribing antibiotics for viral infections, patients should finish the whole course, and hospitals use strict hygiene.