Cats purr when petted as a way to communicate contentment and relaxation. Purring can also indicate that a cat is seeking attention or is feeling comfortable and safe in their environment. It is believed that the vibrations produced during purring have a calming effect on the cat, helping them to relax and enjoy the interaction with their human or other animals.