Cats purr by using their larynx and diaphragm to create a low-frequency sound. This sound is produced by the vibration of the vocal cords when the cat inhales and exhales. The purpose of purring is thought to be a way for cats to communicate contentment and comfort, and it can also be used to indicate distress.