Cooking an onion transforms the vegetable's chemical composition; slowly cooking it in fat until it is a rich golden brown renders it far sweeter than when raw. "New compounds are formed," writes Shirley Corriher in CookWise (William Morrow and Company, Inc., 1997). "Some of the compounds that form in onions are even sweeter than sugars." It's all part of the process of caramelization, which is actually quite a complex one. Starches are breaking down into sugars, and the sugars themselves are breaking down, with disaccharides splitting into simpler, sweeter monosaccharides. The onions' moisture evaporates, too, concentrating its newfound sweetness. Cell walls break down and the vegetable loses its shape, collapsing into a soft, jam-like consistency. Another of the many processes at work while onions saute is the Maillard reaction, wherein the onion's carbohydrates and proteins interact with the sugars to create a deep brown color and rich, umami-packed, almost meaty flavor. (Butter is the medium of choice for caramelizing onions, since its own proteins faciliate the process.) The goal is to caramelize gradually, at a low enough heat and stirring often, so that the sugars don't brown too much, which would result in a toasty, roasted, or grilled onion flavor rather than a concentrated sweetness.