Shampoo comes from the Hindi word chhampo meaning ‘press’. To shampoo someone was to massage them.
The meaning changed over time and as shampooing was part of the Turkish Bath ritual it changed to mean part of the cleansing process.
To shampoo the hair was to cleanse and massage the scalp. Shampoo still has this meaning – as a verb but also came to mean the liquid that we use to wash our hair. This usage of shampoo as a noun came about in the 19th century.
We also now use shampoo to clean our pets, cars and carpet.