The ‘bite’ of raw onions, and the typical onion and garlic odours, are due to a complex of sulphur compounds. When an onion is cut, the crushing of the cells and the admission of air allows an enzyme to work on these substances. One effect is to develop pungency. Another is to release the volatile substance allicin, which irritates the eyes.
If onions are peeled and chopped under running cold water this washes away the allicin; but it may be inconvenient. A simpler method is to chill the onion in the refrigerator before working on it. The cold reduces the volatility of the substance.