As a general rule, animals make low-frequency vocalizations when they're in positive social situations, but cats purr for all sorts of mysterious emotional reasons.
Kittens are born blind and begin their purring journey when they're just a few days old, probably to let the mother cats know where they are during feeding times. Cat owners often observe this in adult cats as well — some cats purr to let you know they're hungry, or even while in the process of eating.
Only in the past 20 years have animal behaviorists considered that a purring cat might not be 100 percent satisfied. While it's most common to hear a cat's purr when they're snuggled up on their favorite lap getting their head scratched, cats also purr at the vet, when they're alone, when they're dying or after they've been threatened by another animal. A momma cat will purr when her babies are nursing. Cats purrs can also have a meow hidden within them — a cry even people who don't spend much time around cats can pick up.