It probably began with an accident thousands of years ago. According to one legend, rain washed the fat and ash from frequent animal sacrifices into a nearby river, where they formed a lather with a remarkable ability to clean skin and clothes. Perhaps the inspiration had a vegetal origin in the frothy solutions produced by boiling or mashing certain plants. However it happened, the ancient discovery of soap altered human history. Although our ancestors could not have foreseen it, soap would ultimately become one of our most effective defenses against invisible pathogens.

People typically think of soap as gentle and soothing, but from the perspective of microorganisms, it is often extremely destructive. A drop of ordinary soap diluted in water is sufficient to rupture and kill many types of bacteria and viruses, including the new coronavirus that is currently circling the globe. The secret to soap’s impressive might is its hybrid structure.

Soap is made of pin-shaped molecules, each of which has a hydrophilic head — it readily bonds with water — and a hydrophobic tail, which shuns water and prefers to link up with oils and fats. These molecules, when suspended in water, alternately float about as solitary units, interact with other molecules in the solution and assemble themselves into little bubbles called micelles, with heads pointing outward and tails tucked inside.

Some bacteria and viruses have lipid membranes that resemble double-layered micelles with two bands of hydrophobic tails sandwiched between two rings of hydrophilic heads. These membranes are studded with important proteins that allow viruses to infect cells and perform vital tasks that keep bacteria alive. Pathogens wrapped in lipid membranes include coronaviruses, H.I.V., the viruses that cause hepatitis B and C, herpes, Ebola, Zika, dengue, and numerous bacteria that attack the intestines and respiratory tract.