Homemade Detergents typically feature water softeners (such as washing soda), stain removers (such as sodium percarbonate) and soap such as Sunlight Soap or Lux Flakes.
Soap is a mild surfactant compared to the surfactants in commercially available laundry detergents and is suitable for stain removal. It won’t achieve a good clean in an automatic washing machine, but can be used with old fashioned wash boards.
Soap reacts with minerals in water and forms soap scum, the same soap scum that builds up in the shower and bath. Soap scum can build up on fabrics and over time this can trap bacteria, ammonia and cause repelling, which is why it isn’t recommended for use with anything other than a wash board.
Surfactants are needed to remove soiling from fabrics. The hydrophilic head, holds onto water, the hydrophobic tail holds onto soiling, which is then washed away. See The Wash Wise Detergent Ingredients Info Sheet for a detailed explanation of how they work.