According to Bruce Fogle, a veterinarian with a keen interest in animal behavior and author of The Cat's Mind, the original function of purring was to enable a kitten to tell his mother that "all is well." This often occurs during nursing. A kitten can not meow and nurse at the same time, but it can purr and nurse without any problem. The mother often purrs back, reassuring the kitten.
Older cats may purr when they play or approach other cats, signaling they are friendly and want to come closer. Cats also purr when they are contented, such as when they are petted, again giving the signal "all is well."
Strangely enough, cats can also purr when they are distressed. Sick and injured cats, and those in veterinary offices often purr. It is thought that this is the cat's way of reassuring and calming herself.
When a cat is purring, it is almost impossible to hear the cat's heart or lungs very well. Many cats will stop purring if they see running water from a faucet. You may see your veterinarian turning on the faucet in the exam room in an attempt to get your cat to stop purring so your cat can get a better exam.