Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are usually used for washing, bathing, and other types of housekeeping. In industry, soaps are used as thickeners, components of some lubricants, and precursors to catalysts. When used for cleaning, soap solubilizes particles and grime, which can then be separated from the article being cleaned. Where soaps act as surfactants, emulsifying oils to enable them to be carried away by water.
Soap is created by mixing fats and oils with a base, as opposed to detergent which is created by combining chemical compounds in a mixer. Humans have used soap for cleaning for millennia.
Evidence exists of the production of soap-like materials in around 2800 BC in ancient Babylon. n a domestic setting, "soap" usually refers to what is technically called a toilet soap, used for household and personal cleaning. When used for cleaning, soap solubilizes particles and grime, which can then be separated from the article being cleaned. The insoluble oil/fat molecules become associated inside micelles, tiny spheres formed from soap molecules with polar hydrophilic (water-attracting) groups on the outside and encasing a lipophilic (fat-attracting) pocket, which shields the oil/fat molecules from the water making it soluble. Anything that is soluble will be washed away with the water.
The production of toilet soaps usually entails saponification of fats (triglycerides). Triglycerides are vegetable or animal oils and fats. An alkaline solution (often lye or sodium hydroxide) induces saponification whereby the triglyceride fats first hydrolyze into salts of fatty acids. Glycerol (glycerin) is liberated. The glycerin can remain in the soap product as a softening agent, although it is sometimes separated. The type of alkali metal used determines the kind of soap product. Sodium soaps, prepared from sodium hydroxide, are firm, whereas potassium soaps, derived from potassium hydroxide, are softer or often liquid. Historically, potassium hydroxide was extracted from the ashes of bracken or other plants.
Lithium soaps also tend to be hard. These are used exclusively in greases. For making toilet soaps, triglycerides (oils and fats) are derived from coconut, olive, or palm oils, as well as tallow.[9] Triglyceride is the chemical name for the triesters of fatty acids and glycerin. Tallow, i.e., rendered beef fat, is the most available triglyceride from animals. Each species offers quite different fatty acid content, resulting in soaps of distinct feel. The seed oils give softer but milder soaps. Soap made from pure olive oil, sometimes called Castile soap or Marseille soap, is reputed for its particular mildness. The term "Castile" is also sometimes applied to soaps from a mixture of oils, but a high percentage of olive oil.
Reference: https://en.wikipedia.org/wiki/Soap