Mutations of bacterial pathogens produce new strains. Some strains might be resistant to antibiotics, and so are not killed. They survive and reproduce, so the population of the resistant strain rises. The resistant strain will then spread because people are not immune to it and there is no effective treatment.