As living organisms, bacteria are encoded by DNA, and DNA occasionally mutates. Sometimes genetic mutations render a bacterium immune to an antibiotic’s chemical tactics. The few cells that might escape antibiotic pressure then have a sudden advantage: with their counterparts wiped out, resources abound, and the remaining antibiotic-resistant bacteria proliferate. It’s a problem not only for the host—you or me when we are treated with an antibiotic and develop a resistant strain—but also for anyone with whom we happen to share our resistant bacteria, say, on a door handle or keyboard. In fact, most resistant bacteria develop not in people but in livestock fed antibiotics to promote growth; these resistant bacteria infect people through contaminated animal products. This is how even antibiotic “naive” people come to be infected with resistant strains of bacteria.
I see this all the time as a family doctor. A woman has a urinary tract infection. I tell her that her bacteria are resistant to this or that antibiotic, and she says, “But I’ve never taken any of those.” Welcome to the global human soup.
A succinct definition of evolution is “The change of allele frequencies over time.” Even “allelic drift” is evolution.
For bacteria, population sizes are big enough that simple variants like base substitutions can occur at every single base in the genome over a short period of time. Some of these are important to the development and redevelopment of resistances. Once one allele has spread enough, compensatory mutations can bring about combinations that weren’t seen before.
Antibiotic resistance is definitely an evolved trait, and it’s the reason why multi-resistance and resistance to brand new antibiotics is becoming such a problem.