Detergents make use of the fact that water sticks to itself.
Like soap, detergents are surfactants; water jams surfactant molecules between the surfaces of dirt and clothing fiber to pry the dirt particles loose and keep them from sticking again.
Unlike soap, detergents can work in “hard” or mineral laden water almost as well as in soft water, but their basic cleaning action is the same as that of soap.
The cohesion of water is the key to the surfactant process. Water molecules stick together because they are dipolar, each one has two poles, positive and negative. A water molecule (H2O) is laid out like a triangle, with an oxygen atom at one end and the two hydrogen atoms at the other.
The oxygen atom, the triangle’s vertex, has a negative electric field around it, and the hydrogen base of the triangle has a positive field. The molecule as a whole is electrically neutral, with equal numbers of positive and negative charges, but its positive and negative parts are comparatively far apart, and this affects how water behaves. Like charges repel each other and opposite charges attract; dipolarity makes water stick to itself because the hydrogen “base” of one molecule is attracted to the negative oxygen “vertex” of another molecule.
Thus water molecules are always trying to stay next to other water molecules; this self attraction or surface tension makes water an inefficient cleaning agent without a surfactant, and a very efficient one with a surfactant.
By itself, water does not “wet” other materials very completely; it draws itself into little spheres or droplets instead of spreading out into the fabric fibers. A surfactant molecule has parts that allow it to reduce water’s surface tension so that it can penetrate fabric better; it also uses water’s surface tension as a force to dislodge dirt in the fabric.
As soon as it is mixed with water, the detergent molecule sodium alkylbenzenesulfonate drops its sodium atom, but one of the sodium’s electrons stays attached to the molecule. The sodium thereby becomes a cation, or positively charged particle, because it has lost one (negative) electron. The remaining larger part of the molecule keeps the extra electron and is therefore a negatively charged particle, or anion. Sodium alkylbenzenesulfonate is an anionic surfactant, because it is the anion that does all the work of cleaning.
The anion has two parts, a “head” and a “tail,” that act together to pry grease particles loose. The head, made of sulfur and oxygen, is hydrophilic, or attracted to water, because its arrangement of electrical charges complements an opposite pattern of charges found in groups of water molecules. This works similarly to the way water attracts itself. The tail, a long chain of carbon and hydrogen atoms, has no particular affinity for water and is called hydrophobic (“water hating”).
As soon as the sodium ions drop off, the remaining anions spread quickly throughout the solution, led by their eager hydrophilic heads seeking water. At the same time, the water molecules, permeated and overrun by anions, continually try to regroup and stick back together. Their affinity for each other is greater than their affinity for the anions’ heads. As the water sticks back together, the anions are forced outward toward all the surfaces: where the water meets the air and the sides of its container, and into the clothes in the washing machine.
At the same time the hydrophilic heads of the anions are pushing back at the water, drawn by electrical attraction.
The effect on the water is to spread it out, flattening the spherical droplets that have formed on the clothing, breaking them into smaller droplets and flattening them again, spreading them deep into the clothing fibers. This pressure from the anions forces the water into contact with a greater area of fiber, the way pressing an inflated balloon on a tabletop with one’s hand increases the area of the balloon that touches the table.
The water, however, keeps regrouping, always forcing the anions outside itself. Most importantly, it forces them, hydrophobic tails first, far into the crevices between fiber and greasy dirt. Pressed on all sides by the water, the anions pry the dirt loose and surround it, hydrophilic heads all pointing out into the water like hairs standing on end. Once the dirt particles are removed and surrounded this way, they cannot restick to the fibers, since there are now anions coating every surface, anions all have negative charges, and like charges repel each other. So the dirt stays suspended until it is thrown away with the rinse water.
The major difference between soap and detergent is that detergent contains special additives, usually phosphates, that electrically soak up stray minerals such as calcium ions from the wash water. Calcium ions are positive and can attach themselves to the heads of the (negative) surfactant anions, making them useless for cleaning.
By adding phosphate anions to the water, one can draw off the calcium cations and keep them out of the way while the surfactant molecules clean the clothes.