Why Do Cats Knead?

When cats in their typical characteristic style make a motion of rhythmically pushing their paws in and out alternately against a soft object, they are said to be kneading.