Why do you need to fry onions and garlic before adding other ingredients to a dish?
It's not so much the taste as the texture. If they haven't been sauted first, the onions stay relatively crunchy during the rest of the cooking. The same is true of the garlic, but you'd usually have cut the garlic into much smaller pieces so it doesn't take as long to soften up, hence kicking the onion off first and adding the garlic a bit later.