The action of cutting onions causes a reaction between chemicals in the onion cell walls and the cells, this produces a form of sulphenic acid gas which makes your eyes water. To reduce the impact on your eyes you can either reduce the amount of gas produced or stop the gas from reaching your eyes. https://youtu.be/KYDNbM0z_RA
It's their revenge on you for cutting them. But seriously, it's meant to deter things from eating them. Which of course is one reason we (as humans) eat them, because humans are weird and we sometimes like pain. Kinda like hot peppers, they got spicy to discourage anyone but birds (who can't taste spiciness, and are the best seed spreaders) from eating them. But that kinda backfired in the case of us weirdo humans.
Mammoth-Mud-9609 t1_iyf49ry wrote
The action of cutting onions causes a reaction between chemicals in the onion cell walls and the cells, this produces a form of sulphenic acid gas which makes your eyes water. To reduce the impact on your eyes you can either reduce the amount of gas produced or stop the gas from reaching your eyes. https://youtu.be/KYDNbM0z_RA