Cats knead for a variety of reasons, some of which are:
Comfort and security:
This kneading behavior is a leftover instinct from their kitten days. As kittens, they knead on their mother to stimulate milk flow and promote bonding. Even as adults, kneading on soft objects can bring back happy memories and feelings of comfort and security for your cat

Marking territory:
Cats have scent glands in their paws. These glands release pheromones, which mark their territory on blankets, furniture, or even you.
Shopping for a new bed for your cat? Click the picture below and enter JERRY80 at check out to get 80% off your order.

Getting comfy:
Cats knead tall grass to create a comfortable sleeping spot. They may also knead blankets or pillows, a behavior their ancestors performed before curling up for a nap.

Showing affection:
Kneading is often accompanied by purring, a sign of contentment and happiness. It’s a sign that your presence makes them feel happy, relaxed, and secure.
