Cats have been studied for scientists for years to determine how exactly they purr. Despite being one of the world's most universally recognized phenomena, the exact mechanism by which the cat purrs has been frustratingly elusive for scientists. This is partly because the cat has no obvious anatomical feature unique to it that would be responsible; and may also be partly because a cat placed in a laboratory for examination is unlikely to make the noise.
One theory is that cats produce the purring noise by vibrating their larynx, or voice box, in a particular manner. A timing mechanism in the brain sends neural messages to a muscle in the larynx, rhythmically opening and closing the air passage approximately 25 times per second. Combined with the steady inhalation and exhalation of air as the cat breathes, a purring noise is produced with strong harmonics.
Another possibility is that another area of soft tissue or muscular tissue in the neck or torso (e.g., the diaphragm) similarly vibrates.
Cats that roar lack the purring vocal cords, and use the vocal cords in charge of roaring and growling instead, making a noise similar to growling when they purr. As a result, the two sounds are often confused. The roar in these cats is a very loud growl with respect to the production method. Additionally, because these cords can only be used while exhaling, the purring equivalent sound can only be made while exhaling.