Answer:
Shampoo is a form of soap and as such, helps to dissolve oily or greasy materials. Water can then wash away the dissolved material, along with pretty much any other form of dirt in your hair.
shampoo is a chemical that is attracted to grease and oil, when you shampoo your hair the shampoo is attracted to the grease, as you stimulate your scalp you activate your sweat glands and this removes the grease/oil from your hair during the reaction between the shampoo and water. however if you over activate your sweat gland this reaction can cause your hair to become more greasy/oily... not only does this remove grease and oil it removes other substances and dirt by using different shampoos and conditioners.