Why do cats knead?

Cats knead for various reasons including comfort, marking territory, and showing affection.