It would appear that soap is a magic substance that recognizes and respects our skins and precious possessions while devouring everything else under the sun like a vulture leaving only bones behind.
But no such magic substance exists. Instead, the answer has to do with the natures of oil and water. Simplistic as it may sound, everything that we call dirt, more politely, “foreign substance”, is either oily or is stuck to us with oil. And soap is a uniquely good oil remover.
Before we can figure out how to remove dirt, we must look at how we get dirty in the first place.
A microscopic speck of dirt, meaning anything we don’t want attached to us, can be stuck on in one of two ways: either it is mechanically trapped in a microscopic crevice or else it is moist, and the moisture makes it adhere. An example of the former is the kind of dirty you get on a dusty road; an example of the latter is the kind you get on a muddy one. In either case, a good hosing down with plain water, encouraged perhaps by a little rubbing, will do a reasonable job of removing the foreign substances. Soap isn’t really necessary.
But what if the dirt particles have a slightly oily coating instead of a watery one? They will stick to your skin just as the wet mud did. In fact, the dirt doesn’t even have to bring along its own oily coating. There is often enough oil on our skins to make dirt particles stick. Unlike the mud, however, this dirt is going to stay stuck, because oil doesn’t evaporate and dry up as water does. Nor will a spray of plain water dislodge it, because water won’t have anything to do with oil; it will simply roll off the dirt as it would off a duck’s back, which, as you know, is covered with oily feathers.
It seems, then, that the only thing we can do to unstick oil-adhering dirt is to seek and destroy the sticky oil itself. The dirt will then be able to fall off or be swept away by a liquid.
Well then, let’s fill the old bathtub with alcohol, kerosene, or gasoline; they’re all good solvents for oil, aren’t they? That’s what dry cleaners do to our dirty clothes: They tumble them around in a barrel full of a solvent such as perchlorethylene, or perc for short, an organic solvent that is a phenomenal dissolver of oil. They call the process “dry” cleaning in spite of the fact that it involves sloshing things around in a very wet liquid. The thinking seems to be that if it isn’t water, it isn’t wet. Wrong, of course.
Unfortunately, perc in the bathtub would kill you even faster than the alcohol, kerosene, or gasoline would, so we can forget about bathing in solvents. But there is one substance that is just as good, and it’s not very toxic (mouths have reportedly been washed out with it): soap. Soap doesn’t actually dissolve oil. It accomplishes the astounding feat of enticing the oil into the water, so that the oil and its captive specks of dirt can then be flushed away.
Soap molecules are long and stringy. For almost all of their length (the “tail”) they are exactly the same as oil molecules and therefore have an affinity for other oil molecules. But at one end (the “head”) they have a pair of electrically charged atoms that just love to associate with water molecules, and this head is what drags the whole soap molecule into the water, makes it dissolve. While swimming around in the water, if a gang of dissolved soap molecules encounters an oily particle of dirt, their oil-loving tails will latch onto the oil, while their water-loving heads are still firmly anchored in the water.
The result is that the oil is pulled into the water; its captive dirt particle is released from whatever it was stuck to and can be swept down the drain.