Onions contain acidic sulfur compounds which turn to a vapor when oxidized, the hydrogen ions from acidic compounds irritate the mucous membranes of the eyes and nose leading to the painful tears.
Onions release gases including sulfur that reacts and makes your eyes water. Running cold water over the onion when cutting will reduce your tears or if you chew gum with your mouth closed.