It’s all in how you slice it.
If the onion is known for possessing any single quality, it’s of course the tear-inducing miasma it gives off when it’s cut. This is the onion’s defense mechanism against being eaten my large mammals such as ourselves. Its design is ingenious. Each cell contains not one, but four different offensive chemical compounds. Left alone, those compounds remain in the cell fluid as inoffensive long-chain molecules. Damage that cell though, and a special enzyme that’s stored separately in the cell is released, and goes to work breaking up those molecules up into volatile, irritating chemicals. These chemicals then take to the air, landing on sensitive membranes in the eyes and nose, where they break down into various nasties, including sulfuric acid. The effect is…well, you know the effect. Of all the members of the allium family, it’s garlic that produces the highest number of these defensive compounds, something on the order of a hundred times that of a typical onion, though it’s interesting that none of them make you cry.
The neat thing about this defensive chemical process is that it can be manipulated to produce a variety of culinary effects. Slice an onion, especially down its length, and you do relatively little damage to its flesh. The result is a milder flavor, great for sandwiches. Chop it and the result is a stinging, sulfurous pungency. The same thing goes for garlic, which explains why when you merely slice or chop garlic you get a pronounced, though somewhat mellow and rounded flavor. Mash it through a press and you get an atom bomb of garlic-ness. Thus, depending on the application, it pays to consider what effect you’re trying to create whenever you lay an allium down on the cutting board.