Antibiotic resistance is often described as bacteria becoming immune to a drug. What actually happens is a shift in which bacteria survive and reproduce.
Resistance exists before the drug is used
Bacterial populations carry enormous genetic variation. In any large population, a few organisms already possess a trait that blunts a given antibiotic.
Those traits are ancient. Many antibiotics originate from moulds and soil bacteria, and the organisms living alongside them evolved defences long before any of this was used in medicine.
So the drug does not create resistance. It reveals and then rewards the resistance that was already present at low frequency.
Treatment applies a selection pressure
When an antibiotic is taken, susceptible bacteria die. The rare resistant ones survive, and they now have space and nutrients that were previously contested.
Bacterial generations are measured in minutes to hours, so a survivor can rebuild a population quickly. What was a fraction of a percent becomes the dominant strain.
This is why the frequency of resistant strains in a community tracks how heavily a class of antibiotic is used there.
Resistance genes move between organisms
Bacteria do not only pass genes to their offspring. They exchange loops of DNA called plasmids directly with neighbours, including neighbours of a different species.
A plasmid can carry resistance to several drug classes at once. Using one antibiotic can therefore select for resistance to others that were never prescribed.
This horizontal transfer is why resistance can appear in an organism that has had little exposure to the drug in question.
Why incomplete and unnecessary courses both matter
An antibiotic given for a viral illness kills nothing relevant but still applies selection pressure to every bacterium the person is carrying.
Sub-therapeutic exposure is a particular problem, because concentrations too low to clear an infection are still high enough to favour partially resistant organisms.
The details of how long any given course should run are clinical decisions that have been revised as evidence accumulates, and they belong with the prescriber.
Why the problem is collective
Resistant organisms circulate. A strain selected in one person can colonise another who has never taken the drug, including through food production and water.
That makes prescribing restraint a shared resource question rather than an individual one, which is why surveillance and stewardship programmes operate at population level.
It also means the benefit of restraint is diffuse and delayed, while the cost of prescribing falls on one visible patient, a mismatch that makes the problem persistently hard to manage.