When raw garlic is cut or crushed, enzymes convert the nonsmelly compound alliin to allicin, which is then further modified into three other sulfur - containing compounds, all four of which contribute to garlic's delectable scent. (sciencemag.org)
Allinase is an enzyme that interacts with a sulfur compound called alliin when the onion tissue is damaged, generating different sulfenic acids, which are responsible for making people cry when chopping the raw bulbs. (herbazest.com)
(Cooking garlic probably prevents the conversion of alliin to allicin, or breaks down allicin quickly.) (sciencemag.org)