Caffeine metabolism primarily occurs in the liver through the cytochrome P450 enzyme system, leading to the formation of active metabolites like theobromine, theophylline, and paraxanthine, which exert various physiological effects. Genetic variations, age, liver function, pregnancy, and other factors can significantly influence the rate of caffeine metabolism and its subsequent biological impacts.