Grating an onion releases more of its juices and breaks down its cellular structure more completely than chopping, resulting in a smoother, almost creamy texture, while chopping leaves distinct pieces.
When you chop an onion, you're essentially cutting it into smaller pieces. This process preserves some of the onion's cellular structure. The cell walls remain relatively intact, and the onion retains some of its firmness and distinct texture. Chopping is ideal when you want to have visible pieces of onion in your dish, contributing to both flavor and texture.
Grating, on the other hand, is a much more aggressive process. It involves rubbing the onion against a grater, which completely breaks down the cell walls. This releases a significant amount of onion juice and creates a pulp-like consistency. The resulting texture is much smoother and almost creamy, as the onion's structure is almost entirely destroyed. Grated onion is excellent when you want the onion flavor to blend seamlessly into a sauce or dish without any noticeable pieces. It also helps to thicken sauces due to the released starches.
Be careful when grating onions, as the process releases volatile compounds that can cause your eyes to water. Try chilling the onion for about 30 minutes before grating to minimize this effect.