According to How Stuff Works:
Although no one knows exactly what happens in the cat's brain, it is known that the chemical nepetalactone in catnip is the thing that triggers the response. Apparently, it somehow kicks off a stereotypical pattern in cats that are sensitive to the chemical. The catnip reaction is inherited, and some cats are totally unaffected by it. Large cats like tigers can be sensitive to it as well.
I want to see a tiger playing with a bushel of catnip.
The feline receptor for nepetalactone is in the vomeronasal organ, located above the feline palate. The location of the vomeronasal organ may explain why cats do not react from eating gelatin-enclosed capsules of catnip. Nepetalactone must be inhaled for it to reach the receptors in the vomeronasal organ.
This vomeronasal organ is also known as the Jacobson's organ, described here:
While snakes and other reptiles flick substances into Jacobson's organ with their tongues, several mammals (e.g., cats) exhibit the Flehmen reaction. When 'Flehmening', an animal appears to sneer as it curls its upper lip to better expose the twin vomeronasal organs for chemical sensing.
Oh my gosh, so "flehmening" is that horrible face cats make when they smell something and have a disgusted look on their faces. I always felt insulted if Patches did that around some food I was eating.