When kittens are first born they are totally dependent on their mother for their nutrition. When they suck at their mothers’ teats they tread with alternate front paws at her body to stimulate the flow of milk.
If your cat is kneading on your lap or chest when you have a cuddle this shows that it associates the intense and secure nature of your relationship with that of its mother when it was a tiny kitten. Some cats will take the process one step further and dribble uncontrollably as they anticipate the milk-feed that kneading usually predicted.
Cats grow out of this behaviour when it ceases to be necessary but a few will retain it into adulthood, particularly when in the presence of someone with whom they feel safe or when they get on a particularly fluffy cushion or blanket.