Peeling, cutting or crushing an onion's tissue releases enzymes
called allinases, which convert these molecules to sulfenic acids.
The sulfenic acids, in turn, spontaneously rearrange to form
syn-propanethial-S-oxide, the volatile irritating chemical that
triggers the tears. (Taken from Scientific American)