It's called "purring" I guess. Not only domestic cats but many other cat species do it as well.
It is most commonly done when the cat is feeling special by you, like you are giving her care like a baby, the cat is very happy with you at the moment, and she expresses that she is very happy with you by "purring".
Not all cat do it, also some do it less, some do it more. It also differs from one cat breed to another.
Below is an excellent youtube video about "purring":
Also scientists say that cat "purring" is an excellent anti-depressant and a medicine for general mental health.