When onions are cooked until brown, it's called caramelizing them. The natural sugars in the onions thicken to a caramel consistency, giving the onions a richer and deeper flavor.