What makes soap lather?

Does anyone know what makes soap and shampoo lather and get all foamy? I think it might be fun to make my own, and I’m not sure what ingredient causes this.

http://www.discover.com/ask/main5.html

http://www.discover.com/ask/main.html