I was both annoyed and curious about this, so I decided to do a little research on the topic, and here's what I found out. First of all, nobody is even totally sure how cats purr, even though scientists have been trying to figure it out for years. This is the latest theory I was able to find: It all starts in the cat brain, where something called a "neural oscillator" sends messages to the muscles around the vocal cords, and that makes them vibrate between 25 and 150 times every second. This happens while a cat is breathing in and also breathing out, so the purring just goes on without having to stop for the cat to take a breath. A process like this seems like it would be hard to learn, but cats are born somehow already knowing the way to do it. Which is one of the things that makes them sort of spooky and mysterious.
Anyway, now we will talk about why cats purr. Most people think it is all about cats' being happy when people pet them, but my research shows that it's not quite that simple. Cats also purr when they are in pain or when they are giving birth or when they are scared or when they are dying. So it's not just about being happy.
To me, it seems like cats purr as a kind of "calming signal," which is what dogs do when they are trying to show another dog or a person that they are not a threat. Dogs might do this by yawning or turning their heads to the side. But cats seem to do it by purring. Which would explain why cats purr at the vet's office, where they are very nervous, and the vet can't even hear their heartbeat because of the loud purring. Cats also purr for humans to show that they are friendly and that they might like to be petted or fed some yummy food.
And I am guessing that the purring noise also calms the cat itself, besides calming other cats or kittens or humans. But guess what else purring does: it can actually help heal a cat! Scientists have figured out that sounds in the frequency of the cat's purr can make bones get stronger. So this might be why cats don't have hip dysplasia and some of the other bone and joint problems that dogs have.
Cats like to sleep a lot, as you might know, and if they are sleeping so much, their bones can lose density, but if a cat purrs while it is sleeping, it keeps its bones from getting all soft and breakable. This is important information for scientists who work with astronauts, because when astronauts are up in space for a long time without gravity, their bones lose their density. So if astronauts could learn to purr, they might not have this problem. Well, I say, good luck getting astronauts to purr! Hahahaha!
Anyway, that's pretty much what I learned about why cats purr. But I think the most important reason of all wasn't even mentioned in my research, which is that purring is the cat's secret weapon against dogs in the battle to win the love of humans. And sadly, it seems to be working. So many people have been fooled into thinking that cats like them, just because cats sit in their laps and purr, that now there are more cats than dogs as pets in the U.S. Which just isn't right, if you ask me!