Onions like many other foods produce a very strong and yet unmistakable smell when they are prepared and cut. However the difference with onions is that many people find that when they chop up onions that their eyes begin to water as if they are crying. What most people don't realize however is how or why this happens to them. The answer is basically that a certain enzyme is released by the onion that mixes with the air to form another compound that causes irritation to the eye, in turn stimulating the glands in our eyes that produce tears.
The chemical released by the onion from its cells when they are broken is called Lachrymatory-factor synthase, which upon its release into the air reacts and becomes an unstable amino acid. This then reacts again and finally becomes Syn-propanethial-S-oxide, which is the chemical that actually causes the eyes to water. This compound gas actually causes irritation to the eye and is a form of very mild sulfuric acid. The brain then tells the tear duct to produce more tears to cover the surface of the eye, and so dilute the stinging acid before it damages the eye any further.
Luckily enough there are plenty of ways that you can avoid this happening when preparing onions. Firstly it is always easier to reduce the effects of the chemicals by chopping onions under running water, as this helps to dilute the enzyme as it is produced. Another method is to peel the onion first and then let it sit in the refrigerator for a while before cutting it. this lets some of the chemical content of the onion dissipate prior to use.
However the strength of the taste of the onion is often related to how much of these chemicals they contain. The stronger the tear producing effect, the stronger the flavor of the onion will be. This being the case it is best not to try to reduce the effects too much in case you reduce the flavor too much.
There are certain types of onions that are stronger and weaker in this respect so knowing what type you might want to have for what food is always useful. For example you might want to use a very strong type of onion when using it for baking into a pie for example. Whereas you might not want to use a very strong onion for a sandwich as it might smother all the other flavors you have used with it.