Our bodies product tears for different reasons, to keep our eyes moisturized, and to protect our eyes by washing out harsh irritants. Tears are also a way we communicate our emotions. Referring to your question,when your eyes become irritated, the tear gland product tears to flush out the eyes. Your teary-eyes is in response to harsh irritants of Onions as well as some others such as smoke or dust in the air.
Things that dry out your eyes like cold air or wind, or stimulants such as bright light and hot or peppery food may also cause tearing. Even yawning, vomiting or coughing are forms of irritationâ€”the manipulation of facial muscles can squeeze the tear glands and force out excess tears.Sensory nerves in your cornea communicate an irritation in your eye to your brain stem, which in turn sends hormones to the tear glands. These hormones cause the eyes to produce tears to get rid of the irritating substance.
It's not actually the whole onion that makes you tear up. Cutting just the root and attached shoot part of an onion (otherwise known as the onion's "basal plate") releases an enzyme into the air. When that enzyme combines with water (like the water in your eye) it creates sulfuric acid, which irritates your eyes.