A shampoo with a cream rinse is basically an oil change for your hair. The shampoo takes out the old oil and the cream rinse adds new oil. Surfactants have a polar end and a nonpolar end. The polar end dissolves in water and the nonpolar end dissolves in the oil and grease in your hair.
Agitation loosens the oil and grease.
Water washes it away. Shampoos are so efficient that they effectively remove most of the natural oils in your hair, leaving it dry and unmanageable. Cream rinses help replace the natural oils lost in shampooing and make your hair soft and shiny. Thus a shampoo and cream rinse are basically an oil change for your hair. Let's go to the University of Calgary's Surfactants, Soaps and Detergents Dictionary to learn more about surfactants.