Cats exhibit a behavior where they push out against a soft surface with their front paws alternating between the right and left paw while grasping the surface with each stroke. This behavior is reminiscent of a baker kneading dough and is sometimes referred to as “making biscuits”. As far as we can tell, kneading seems to be an instinctive behavior which most of the time indicates the animal feels secure or relaxed, although excessive kneading may indicate anxiety.
There are many proposed explanations as to why cats knead. Among them are: signaling a desire for attention, showing affection, marking their territory, making their bed, stretching their muscles, and as a throw back to the times they were nursing and they would paw their mothers to stimulate the secretion of milk.
In the video below, Science Cat demonstrates kneading behavior.