No, You Don't Always Need To Saute Onions Before Adding Garlic
Many recipes which include sauteed onions and garlic are very clear that you should start with the former before adding the latter. But is this a distinction with an actual point? Aren't they all going into the same pot? The answer relies heavily on several factors: The size of the pan you're using; how small you've chopped your garlic; the intensity of the cooking heat; and what your desired outcomes are. But we can tell you right now that in a low-heat, wilting application, you can absolutely add the onions and garlic to the pan at the same time without any trouble at all. In fact, the results can be even tastier than sauteing the two for different times.
The reason that people tell you to hold off on adding the garlic is because it browns (and ultimately burns) much more quickly than onions. You can fry onions to a dark, reddish-brown hue and they'll come out crisp and sweet. Try that with garlic and you'll likely end up with bitter, acrid charcoal. The reason has to do with the respective water content of onion and garlic.
Sweatin' it out
No food will start to brown or caramelize until it's reached the required temperature. The first thing that happens when sliced onions or garlic are subjected to heat is that they release their water content. This process makes them softer as they change structure when they lose moisture, which then evaporates. Once that moisture has gone, their temperature can begin to rise above 212 degrees Fahrenheit at which water boils. That's when the browning can begin. The thing is, onions are incredibly watery, while garlic isn't. A typical onion that you'll find in the supermarket is between 70% and 90% water — which is why its volume reduces so dramatically when caramelized. Because of this, it takes onions longer to lose all that moisture.
By contrast, your garden-variety garlic bulb is only 65% water; a big difference. The takeaway is this: If you're trying to get your onions to a golden brown over highish heat and add your garlic to the pan at the same time, you're asking for trouble. Sure, the onions will release their water for a while, preventing any browning from happening until they reach the right temperature. But once that's happened, the garlic will brown in a hurry, especially if it's minced, as smaller pieces burn faster. So, the answer is to cook them both together at a lower temperature. But what do we actually mean by browning?
Browning versus wilting
Onions and garlic turn darker, sweeter, and nuttier because of two non-enzymatic processes: Caramelization and the Maillard Reaction. The former involves the oxidation of sugar molecules, breaking them down to produce a brown color and sweet taste. The caramelization of sucrose and fructose (the sugars in garlic and onions) doesn't begin until 320 degrees Fahrenheit — long after any water content has evaporated as steam. It's often recommended that you should caramelize onions slowly over lowish heat to ensure even browning — they'll get up to temperature once the water's gone. Over medium-low heat, onions need at least 15 minutes and as much as an hour to fully caramelize, while garlic gets there in about five minutes; any longer and your garlic turns bitter.
The Maillard Reaction involves a chemical reaction between sugar and an amino acid. It's what gives us the brown of toast and the gorgeous crust of a seared steak. Just as with caramelization, the Maillard Reaction won't kick into gear until the correct temperature is reached — 285 degrees Fahrenheit and above. So, remember, if all you're trying to do is get the water out of your onions and wilt them a little, which is the goal for the first step in many sauce, stew, and soup recipes, go ahead and toss the garlic in at the same time. The process simply makes the onions more mellow and takes the intense raw flavor out of the garlic.