A major theme of biology is evolution, and there is no better place to study it than with populations of bacteria or viruses (even better than studying it on a tropical beach). The quick replication of these populations allows the process of natural selection to be played in fast-forward. A new strain of virus can evolve very quickly if the right situation arises.
Let's think about a population of viruses where mutations are constantly occurring. A single mutation can affect how well that virus will survive to replicate. Some mutations are favorable, some are unfavorable, and some have no effect.
Those with unfavorable mutations will not replicate as efficiently. Therefore, viruses with an unfavorable mutation will eventually die out. On the other hand, those with favorable mutations will replicate more efficiently. They will have more progeny than the original virus and soon viruses with this mutation will become a larger and larger portion of the population.
A favorable mutation will take over a population until there are none of the original members left? Right. But what kind of a mutation would be favorable? Well, basically anything that helps a virus to replicate better—especially mutations that help them survive an antiviral attack.
Imagine you are a flu virus. You have a genetic condition called weirdo-shape, which makes you look different from the other viruses. You are at a party inside some guy's lungs. You and the other viruses are hanging out, going into cells, and replicating. Suddenly, some drug particles show up uninvited. They begin to attach to all the viral surfaces to prevent everyone from replicating. Oh no.
But they can't attach to your weirdo shape. You have a funny shaped surface and the drug doesn't know what to do. You feel sorry for the other guests, but you decide to party-on without them. You keep on replicating and replicating and replicating. Pretty soon the whole party is filled with funny shaped viruses just like you. In the days and months and years to follow, your weird shaped descendants live happily ever after without worrying about drug particles again. The End.
This is what happens when a virus is resistant to a drug. All it takes is the right "weirdo-shape" mutation to occur and natural selection will do the rest. The quick evolution of viruses and bacteria means research labs are endlessly searching for new treatments to keep up with the times.