Why does a cat purr when you pet it?

Little kittens purr almost constantly during the first month or two after birth.
Somebody* once suggested to me that it was an evolutionary thing…the mother cat can hear each of her babies and know that they are okay and happy.

I’ve never heard anybody else suggest this, but I like the idea. Because there ain’t nothing in the world that’s cuter than a purring kitten.

*a teenage clerk at a pet shop.

Cats also pur when they are in pain

My post was really meant to be a bit whimsical. A sneeze isn’t a learnt action, indeed I challenge you to sneeze at will. Language is learnt, although we need some innate capability to build it on.

As a counterpoint, yodelling might be a human equivalent - and that is most certainly not innate. But, if the theory on specific wiring in cats to modulate vocal cords is correct, the answer is that purring is not learnt, although the social use of purring probably is.