Cat communication consists of a range of methods with which cats communicate with humans, other cats, and other animals. While superficially cats may seem to lack social behavior, in fact close study reveals a wide repertoire of subtle behaviors, which serve cats in their natural wild setting where they form organized hierarchies, and in their domestic interactions with humans.
It is not quite clear how and when purring is used between cats themselves, which may be more indicative of its evoluntionary significance than why it happens when humans are involved. It is likely that purring is a cat's way of communicating to other cats that it is in a sociable mood, or that it has no aggressive intent toward the other cat(s). It may also indicate to other cats in its social group that it is healthy and well.
Purring may also be a signalling mechanism between mother cats and nursing kittens. Female cats are known to purr while giving birth, and this may be to reduce the pain and also assist post-natal healing. Kittens purr while nursing, presumably as an "all's well" signal to their mother.