Kittens can purr not long after birth, sometimes as soon as their second day out of the womb. Purring in very young kittens is associated with suckling. While the kitten feeds from its mother, it purrs, and its mother often purrs back.
Purring initially appears to be a way for mother and young to communicate with each other. It may be a way for the mother cat to signal to her young that she is nearby, which is important as kittens are born blind. A kitten's purring while nursing may serve to alert the mother that the kitten is near and also to encourage the let down response from her milk glands.
Purring continues into adulthood under a variety of circumstances. Most people are familiar with the contented purr, signaling that the cat is feeling pleasant and safe. Cats may also purr when they are experiencing pain or stress. Finally, cats purr to solicit food from their owners. These different kinds of purrs have different vocal qualities that help signal that they mean different things from the familiar happy purr.