Soap
Soap production is the same now as it was in the year zero AD. The process involves the saponification (hydrolysis) of a fat with a strong base. The result is a sodium salt of an acid (soap) and the formation of glycerol. The fat used is commonly a triglyceride that is really three esters bound together on end carbons. In ancient times the base was recovered from leaching wood ashes or using water from natural alkaline lakes. After forming the organic acid the common salt, NaCl was added to precipitate the soap. This was molded into whatever shape was desired and allowed to sit for some time so all the base, NaOH would have time to react. In addition, the soap would harden over time with the result of less being used to achieve the same amount of cleaning. Most soaps contain 12 to 18 carbons in the organic acid and commonly some acids are unsaturated. Soap cleans well in soft water, but forms a ring of precipitate when in contact with hard water. The hard water typically contains iron, calcium or other high valence positive ions. An advantage of soap is that it is biodegradable. The action of soap is that it forms a micelle when in contact with a non-polar substance like oil.
Detergents are of several types of organic molecules that do the cleaning, plus many other things to give whiter WHITES. Phosphate was highly effective in keeping troublesome positive ions in solution, but resulted in speeding eutrophication of lakes and streams. This was because it stimulated the growth of algae that would die and use up the dissolved oxygen in the natural waters. When phosphates were banned because of the problems they caused enzymes were added to detergents to assist in the cleaning.