Onions and their relatives, as we all know from experience, are mild-mannered until we cut into them, at which point they immediately become quite odiferous and may even make our eyes water. The defensive advantage such a property has for the plant is obvious. Garlic was the first of these vegetables to be investigated thoroughly. Its tissue contains an odorless precursor, derived from the common sulfur containing amino acid cysteine, which is stable in normal conditions. When we disrupt the tissue’s cells, this compound is brought into contact with an enzyme that converts it into molecules of ammonia, pyruvic acid, and a mildly garlicky but unstable compound. This in turn breaks down into diallyl disulfide, the major and powerful constituent of garlic odor. Chives, leeks, and onions all follow this general pattern, but end up producing different disulfide compounds, and so have distinct odors. The volatile substance in onions that makes the eyes water - the lachrymator - and the one that burns the tongue both seem to arrive from cysteine derivative that is rearranged by enzymes when the cell contents are mixed. The lachrymator apparently irritates the eyes by dissolving in their fluids and forming sulfuric acid. It is a relatively unstable compound and quickly decomposes in the onion tissue to less obnoxious forms. Unfortunately for the cook, the onion’s production of the lachrymator naturally explodes during the most intimate phase of their relationship: chopping and dicing.
— Quote by Harold McGee, WHEN CHOPPING ONIONS, JUST CHOP ONIONS, 2015