When a cat purrs, it's usually a way for them to express contentment and pleasure. Of course, it can also have other meanings. For example:

1) Expressing satisfaction and pleasure: When cats feel relaxed and at ease, they will purr to express their joy and happiness.
2) To show affection and fondness: Cats will also purr when they are interacting with people or other animals they trust.
3) To release tension: Of course, in some cases, when they face unfamiliar environments or other potential threats, they will also make this sound.