Multiple theories exist that explain why cats knead. Kneading may have an origin going back to cats' wild ancestors who had to tread down grass or foliage to make a temporary nest in which to rest. Alternatively, the behavior may be a remnant of a newborn's kneading of the mother's teat to stimulate milk secretion.
Kneading is often a precursor to sleep.
Many cats purr while kneading. They also purr mostly when newborn, when feeding, or when trying to feed on their mother's teat. The common association between the two behaviors may indicate the origin of purring as a remnant instinct. Some experts consider kneading to "stimulate" the cat and make it feel good, in the same manner as a human stretching.
The cat exerts firm downwards pressure with its paw, opening its toes to expose its claws, then closes its claws as it lifts its paw. The process takes place with alternate paws at intervals of one to two seconds. They may do this while sitting on their owner's lap, which may prove painful if the cat is large or strong or has sharp claws (as the claws tend to dig into one's lap). Though cats will sit happily on a hard surface, they will only knead a soft or pliant surface, although some cats will reflexively "march" on hard surfaces instead of kneading them.
A cat may appear irritated or surprised if it is disturbed while kneading.
In a garden where cats are to be found, sheltered areas can often reveal the "wild" results of kneading: round, cat-sized nests trodden into long grass. Domestic cats also make "nests" out of cardboard boxes and other such things. They do this also by kneading with their claws out, in a manner such as to scratch and soften some of the material. This action is different in manner, body language and intent from kneading when they are happy.
Cats can sometimes adopt a blanket and use it like a security blanket. This will include lots of kneading, purring and suckling at the blanket. In some cases, cats have been observed to exhibit sexual movements, not unlike a dog "humping" a human leg, accompanying the kneading and suckling. Kittens who are taken away from their mothers before they are fully weaned may also develop a habit of kneading a human whom they have adopted as a maternal figure, and suckling their ear, eye, nose, toe, hair, shirt, socks or fingers.. Cats will also do this to fuzzy stuffed animals, such as teddy bears. Cats mainly do so as kittens, but sometimes the behavior continues into adult life.