Onions use sulfur in the soil to create amino acid sulfoxides, which are sulfur compounds that readily turn into a gas. When an onion is cut open, it releases the sulfoxides and enzymes, which react and create a gas called syn-propanethial-S-oxide.

Because onions grow underground, this gas helps deter critters that want to feed on them.

But the gas is also what causes your eyes to water when chopping onions, said Dr. Robert Rosa Jr., an ophthalmologist at the Texas A&M College of Medicine.

"It really is a complicated chemical process that creates the gas," said Rosa. "They all act as precursors that create the lachrymatory processor -- or what makes you tear up."

White, yellow and red onions all have higher concentrations of the onion enzyme necessary to create this gas, while sweet onions, green onions and scallions have lower concentrations. Also, some people are more sensitive to this gas than others, he said.

"Your eyes have a set of nerves that detect anything that's potentially harmful to your eyes. Your eyes react to the gas that is formed, and your eyes try to flush it out with tears," Rosa explained in a school news release.

However, onions pose no serious threat to your visual health.

"Chopping onions can cause some burning and irritation and tears. Other than that, it's pretty safe on your eyes. It's a temporary sensation with no known long-term effects, nor will it worsen any other conditions, like pink eye," Rosa said.

Goggles can prevent the gas from reaching your eyes while cutting onions, but they aren't really necessary, he added.

"Some people may cut the onions in a bowl of water," Rosa said. "I'd personally recommend using eye drops, like comfort drops, to help lubricate or rinse the eyes and dilute the gas exposure to the eyes."