Here's what science has to say:
Before we can talk about how soap makes things clean, first consider: What does it mean to be dirty?
Most of the stuff you try to clean off with soap — food baked onto dishes, dust caked into your skin — is infused with oil. It's hard to wash off with water because water molecules are more attracted to one another than they are to oil. Oil molecules are large and awkward, and they don't have poles — ends with different electric charges — so they're not very easy to bond with. When you try to wash a greasy pan with mere water, it will just run off without picking up the dirty, oily particles that cling to the surface.
But thousands of years ago, people figured out how to make a substance that overcame the deep antagonism between oil and water. If they took a fatty acid, like rendered fat from a cow or sheep, and mixed it with an alkaline substance, like water mixed with ashes, it would produce a thick, brown curd that was incredibly efficient at getting dirt to wash away. This recipe dates back to ancient Roman times.
These days, we make this substance with highly purified oils and industrially produced alkaline solutions, so it looks a lot nicer (and smells better, too). But it's still the same product: soap.
Dear Science: How do we know how old the Earth is?
A soap molecule is perfectly suited to mixing oil and water because it shares some qualities of each. The alkaline substance that helped create it gives it a polar “head” at one end. The electric charge at the head makes it “hydrophilic,” or water loving, since the hydrogen atoms in water molecules have slight positive charges. When you turn on the faucet, the head of the soap molecule will readily bond with the nearest water molecule.
Meanwhile, the fatty acid component gives soap a long tail made of carbon and hydrogen atoms. Like oil, this tail is hydrophobic, so it latches onto the grease on the pan.
Clearly, soap is a pretty powerful substance, capable of some incredible chemistry. In fact, plain old soap is so good at its job that adding antibacterial substances doesn't make it any more effective at eliminating germs, according to the Food and Drug Administration. (Antibacterials may also help breed aggressive, antibiotic-resistant bacteria — another good reason to avoid them.)