Esomeprazole, the active ingredient in Nexium, works by blocking a specific enzyme in the wall of the stomach that produces acid, thereby lowering the amount of acid in the stomach. This action helps in the treatment and prevention of conditions that arise from excess stomach acid. Unlike antacids, which neutralize acid, Nexium reduces the production of acid at the source.