- It spreads flavor throughout the a baked dish better - Grating the onions, garlic, or shallots means a better distribution of flavor throughout the casserole. Instead of big chunks the onion or shallot is finely distributed throughout the mix.
- You don't need to cook the shallots or onion before baking - This is the time-saving reason I do this! If an onion is finely grated instead of cut in big chunks, there is much less need to cook it before folding it into a casserole mix. In my lemony chickpea casserole, for instance, I don't cook the shallots before mixing them in. I just grate them finely and stir them in. Shallots are less assertive than onions, of course, so that helps, but it also helps that you aren't getting any big crunchy bits in your mouth while eating the casserole. Grating the shallots means they are well-distributed, and also well-cooked in the oven.
(Images: Faith Durand)