Humans seem to be fascinated by animals who can do things that we cannot. For example, the HSW question archive answers questions about camel humps, Hawk vision, night vision, fish gills and so on.
And so it is with cats purring. We cannot purr, so we are interested in how cats can do it. It turns out that domestic cats, some wild cats like pumas and mountain lions (in general, any big cat that cannot roar) and even raccoons are all able to purr. Humans happen to smile and laugh when they are happy, and dogs wag their tails. So it is not unusual for an animal to have a physical reaction to happiness. Cats show happiness by purring.
Two of the links listed below describe the actual mechanism that allows cats to purr. It turns out that cats have special wiring! The wiring travels from the brain to the muscles in the voice box, and this wiring is able to vibrate the muscles so that they act as a valve for air flowing past the voice box. According to this page, the muscles work both during inhalation and exhalation -- this creates the impression that cats can purr continuously. The air passes through the valve, which opens and closes rapidly to create the purring sound.
There is lots of good information on purring on the web -- Here are several fascinating links: