Why onions make us cry (and why some don’t)

Mark Anthony in Shakespeare’s Cleopatra may have referred to “the tears that live in the onion”. But why do onions actually make us cry? And why do only some onions make us blub in this way when others, including related “allium” plants such as garlic, barely ever draw a tear when chopped?