When you use a cream on a rash or an inhaler for an asthma attack, it's easy to imagine the drug working directly at the site of the problem. But when you take a drug orally, how does it get to where it needs to be?
First, the drug has to pass through the stomach & then hopefully get digested somewhere along the way before it's ... uh, too late. This is probably the trickiest part of designing a new oral drug - actually getting it absorbed. First there's the acidity of the stomach to consider - often drugs have a protective coating to help them through the stomach. Next, the drug has to be digested, usually in the small intestines. The hard part is that the intestines are designed to absorb nutrients we need... not necessarily the drugs you're trying to take. There are ways to work around this though. If the drug is fatty enough, it will pass through the cell membrane & get absorbed with other fats. Otherwise, the molecule has to be engineered in such a way that it will be absorbed - having a similar shape to a necessary nutrient helps. This is why some drugs must be injected - or why more serious conditions are treated with an IV or shots. You're guaranteed to get high levels of the drug in the bloodstream.
Fine, the drug is absorbed - now what? Distribution. The drug is in the bloodstream & gets distributed throughout the body. But not so fast, it isn't quite that simple (is it ever?). The blood coming from the intestines passes through the liver first. The liver helps to clean out the blood & repackage some of the nutrients so that they can be distributed throughout the body. One of its major roles is metabolism - many compounds & drugs get degraded in the liver. This metabolism can send the compound to be excreted or it can actually activate the drug. Once active, it can hit the bloodstream & exert its effect. If the drug isn't excreted after this metabolism, it will travel through the body until it is eventually voided (via the kidneys, intestines, sweat or shed skin/intestinal cells).
As a recap - you just learned the ABCs of pharmacology - ADME. Absorption, distribution, metabolism & excretion. These are the steps that the majority of drugs pass through on their way through our body. The body is designed to protect us though, & the actual amount of working drug absorbed is usually very small. Which is why you often have to take more than one dose (perhaps over a period of days). This repeated dosing maintains the concentration of drug in the blood above a certain threshold needed for the desired effect to be achieved.
But still I haven't answered the question. How does the drug find the problem? How do antibiotics find the bacteria? Well, the short answer is that it doesn't. Oral drugs are distributed (more or less) evenly throughout the body & thus act everywhere. So if you have a sore knee & a headache, one painkiller will help both pains.