Uhm, just to support what Cordelli wrote... often times in recipes that call for garlic and onions (pretty much everything I make, for example), experienced kitchen hands will tell the uninitiated to put the onions in the oil first, and then the garlic, in order to keep the garlic from burning.
This is a actually incorrect. The point of sauteing the garlic first, is to get the natural garlic oil released into your hot cooking fat, (be it olive oil, or whatever).
If you add the onions first, you're adding a massive amount of water to the equation, and cooling the cooking fat to the point where it is no longer doing its job.
The way to control this is to control the temp of the cooking fat itself (gas stove!!!!!). You can avoid burning the garlic very easily this way.
Oh, and stop it with it the attacks on Cordelli. He's an Italian in Connecticut. He knows people.