When onions are sliced, an organic compound of sulphur is given off. Dissolved in water, it becomes sulphuric acid. So when this compound of sulphur gets into your eyes and dissolves in the moisture there, you have sulphuric acid produced. The old folk prescription for avoiding this: slice your onions under water. Then the acid is manufactured in the water, not your eyes.