Question: what is the difference between the molecules of soaps and detergents chemically?
Answer: Soap molecules are sodium or potassium salts of long-chain carboxylic acids. They form scum upon reaction with calcium and magnesium ions present in hard water. Detergent molecules are ammonium or sulphonate salts of long-chain carboxylic acids. They do not form insoluble precipitates with calcium and magnesium ions.