Soaps contain sodium stearate and detergents contain sodium perborate, which is alkaline. As dirt is acidic, alkaline detergent must be used to clean it.