When fatty acids react with alkalis the result is the formation of soap. Soaps can be made from both fatty acids derived from plants as well as fatty acids derived from animals. The type of fatty acid and alkali used determines the nature of the soap.
Soaps made with vegetable oils like olive oil are soft, coconut oil leads to the production of a lot of lather. Animal fats are generally not used in soaps meant to clean the body.
The metal forming the alkali influences soaps in a similar way. Sodium soaps are hard while potassium soaps are soft and are usually what liquid soaps are made of. Where the soap is to be used for harsh applications lithium is used.
The products of reaction of fatty acids and alkalies are salt and water. From this reaction is liberated either CO2 with carbonates, or hydrogen when they react with elecropositive metals(Mg, Zn).
Example of reaction of fatty acids and alkalies:
The fatty acid CH3COOH is acetic acid (vinegar) is a tricarboxylic acid because it contains three –COOH groups and it reacts with sodium hydroxide.
CH3COOH + NaOH ---------------------- > CH3COONa + H2O