Why saute onions and garlic first?
Usually, it’s because you are building layers of flavour. Onions break down with heat and salt (always salt the onions when you add them to the pan. This is one of the interesting paradoxes of cooking. Alliums (leeks, onions, shallots, garlic) become sweeter when sweated on low heat with salt. The salt also pulls water out of the onions so they cook faster. It’s a combination of caramelization and the Maillard reaction and it creates a deep, satisfying flavour you can’t get any other way. Garlic is added after the onions become translucent because if you burn the garlic it becomes acrid instead of mellow. And we do this before adding the other vegetables because they will release water that will stop the process.
Once the onions have reached the right stage of doneness you can add your other vegetables and cook everything together. In dishes where you want a sharper, brighter onion flavour, you can skip this step and add them right to the pot.[ Source: Quora, Beth Goldowitz ]