We've all seen what happens when a cat is given catnip. They sniff and lick it, rub their faces in it, and then log roll their whole bodies through it. Cats seem to enjoy this process, and appear to be in a mild state of intoxication afterwards. But how does this happen?
The active compound in catnip that causes these behaviors is called nepetalactone, and it only induces the rubbing behavior when smelled, but has no effect if ingested. Interestingly, cats appear to have a stronger response the older they get and there is no difference in response between male and female cats. Some cats have no response at all.
The catnip response has been observed in other felid species, such as captive jaguars, lynx, and leopards. No other species appear to react this way to catnip.
Research has shown that catnip stimulates the opioid center of the brain, the same area in humans responsible for causing euphoria. So when cats smell catnip, they are rewarded with feelings of pleasure.
All of this still doesn't answer the question of why cats rub catnip in the first place.
Since this adaptive behavior occurs with most species of Felidae and without being taught by their parents, there must be a more important function. It turns out that the nepetalactone compound acts as a natural mosquito repellent, so by rubbing their faces and bodies in catnip, cats are protecting themselves from pesky biting insects.
Catnip appears to have a two-fold effect on cats:
Induction of a euphoric state, and protection from mosquitoes which could protect them from mosquito-borne diseases like yellow fever. Because the catnip is inhaled to activate the opioid center, there doesn't appear to be any addictive qualities to catnip, and cats only react to catnip for 5-15 minutes before becoming desensitized to it.
So go ahead and give your furry friend a fun treat!