Bacteria and viruses have extremely rapid generation times, meaning that they evolve and change very quickly. Combined with their natural variability, this means that bacteria and viruses can become naturally resistant to the drugs we use to treat them get selected for by their helpful mutations or "natural selection".