From Scientific America Why do cats purr?
If it’s a form of communication, it’s meant for those near and dear,
since cats purr at a frequency and volume too low to travel far.
Purring (and many other low-frequency vocalizations in mammals) often
are associated with positive social situations: nursing, grooming,
relaxing, being friendly.
From Why Do Cats Purr? It’s Not Just Because They’re Happy
More likely, though, purring is simply soothing, or self-soothing, as
cats may also purr in stressful situations. In that case, purring
would be akin to how humans soothe themselves by crying, laughing,
distracting themselves, or even organizing their desk. Some
veterinarians and cat enthusiasts have observed cats lying alongside
each other and purring when one is injured (a behavior termed “purr
therapy”), though scientific literature on the subject is scant.
Beyond being calming for the injured kitty, “purr therapy” may have
bone healing properties. Domestic cats purr at a frequency of about 26
Hertz, in a range that promotes tissue regeneration. That’s not as
crazy as it sounds: High-impact exercise promotes bone health for the
same reason, because bones respond to pressure by making themselves
stronger.
In their natural setting, cats spend a lot of time lying around
waiting to hunt, so purring may stimulate bones so that they don’t
become weak or brittle.