How are soaps and detergents made?

How are soaps and detergents made?