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.