Cut onions release amino acid sulfoxides, which the eyes perceive as an irritant. The eyes react by flushing the irritant out using reflex tears, a type of tear designed for this purpose.
Onions release these compounds because they take up sulfur from the ground. When they make a chef cry, these compounds cause the eyes to release different tears than the ones released over a bad break-up. The eyes secrete different tears for emotions, lubrication (basal tears) and irritants (reflex tears). Reflex tears are the same ones that fill your eye if you get something in it, as they are designed to help wash whatever it is out of your eye.