Answer explained
Why have detergents replaced soap?
Detergents work well even in hard water (they do not form the insoluble scum that soap does with calcium/magnesium ions), lather more easily, and clean effectively in both soft and hard water. This makes them more convenient and effective than soap for many everyday uses, which is why they have largely replaced it.