Shampoo doesn't have to foam, but we add foaming chemicals because people expect it each time they wash their hair. Same thing with laundry detergent. And toothpaste—now every company adds sodium laureth sulfate to make toothpaste foam more. There's no cleaning benefit, but people feel better when there's a bunch of suds around their mouth. Once the customer starts expecting that foam, the habit starts growing.
The Power of Habit: Why We Do What We Do in Life and Business (ed. Random House, 2012) - ISBN: 9780679603856