Cats knead by pushing their front paws rhythmically into a soft surface.
The behavior begins very early.
Kittens knead while nursing
Newborn kittens press around their mother’s belly while feeding.
That movement helps stimulate milk flow.
Because nursing is associated with warmth, safety, and comfort, the paw motion becomes connected with a very positive experience.
Many adult cats simply keep the behavior.
Why do adult cats knead blankets and people?
A relaxed cat may knead before settling down to sleep.
Soft blankets, beds, and human laps are especially popular because they are warm and comfortable.
A cat that kneads while purring and half-closing its eyes is usually very relaxed.
That does not mean kneading is a perfect happiness meter.
Some cats may also use familiar repetitive behaviors when self-soothing.
Kneading also stretches the body
The motion stretches muscles through the paws, legs, shoulders, and back.
Cats also have scent glands around the paws, so pressing repeatedly against a surface may leave chemical signals behind.
That can help make a sleeping place smell familiar.
Why do the claws come out?
Extending and retracting the claws is part of the normal paw movement.
The cat is not necessarily trying to scratch you.
Unfortunately, your lap may be less impressed by the distinction.
A folded blanket can make the experience easier on the human participant.
Is kneading related to other cat social behavior?
Yes.
Cats use several behaviors around trusted people, including purring, slow blinking, and rubbing against familiar people.
Kneading belongs in that same broad world of comfort and social behavior.
So when a cat kneads your lap, you have probably been classified as warm, safe, and appropriately furniture-like.
And that’s the short explanation.
Related explanations: Why do cats purr?, Why do cats rub against people?, and Why do cats have whiskers?