It irritates the lachrymal glands, causing them to excrete tears. Chewing gum while cutting onions prevents tears by forcing you to breathe through your mouth. This disperses the irritant so that a significantly smaller amount reaches the lachrymal glands, preventing them from being irritated enough to release tears.