A molecule with two loyalties
Grease is soap's great problem: it refuses to mix with water, so rinsing a greasy plate under the tap just slides the water over the top. Soap defeats it with a split personality. Each soap molecule is a tadpole shape with two opposite ends — a head that is attracted to water, and a tail that is repelled by water but attracted to oils and grease.
Chemicals with this two-faced structure are called surfactants, and soap is the oldest of them, made for thousands of years by boiling fats with an alkali such as wood-ash lye or caustic soda. That reaction, saponification, is what turns slippery fat into something that can wash fat away.
Surround, lift, rinse
Add soap to greasy water and the molecules go to work in formation. Their tails burrow into the grease while their heads stay out in the water, until the grease is coated in a layer of molecules all pointing the same way. Agitation — scrubbing, rubbing, the churn of a washing machine — breaks the grease into tiny droplets, each wrapped in its soapy coat: a sphere called a micelle.
The micelle is the trick's payoff. Its outside is water-loving, so the whole droplet, grease and all, happily mixes into the rinse water and flows down the drain. Warm water helps by softening grease, and hard water hinders, because its calcium ions react with soap to form the grey scum that rings a bath.
More than clean plates
The same mechanism explains why washing your hands with soap works so well against germs: many viruses and bacteria are wrapped in fatty coatings, and soap molecules prise those coatings apart, inactivating the germ while the micelles carry the remains away.
Detergents are soap's engineered descendants — surfactants designed to keep working in hard water and cold washes. Different surfactant, same ancient idea: a molecule loyal to both water and grease, ferrying one away inside the other.

