In the skillet, heat 3 tablespoons of oil on medium heat. Add the onions and toss to coat with the olive oil.
1.5 kg red or yellow onions, peeled and thinly sliced, 4 tbsp vegetable oil
Cook the onions, stirring often, until they have softened, about 15 to 20 minutes.
Increase the heat to medium high. Add the remaining tablespoon of olive oil and the butter and cook, stirring often, until the onions start to brown, about 15 more minutes.
4 tbsp vegetable oil, 2 tbsp butter
Sprinkle with sugar (to help with the caramelization) and 1 teaspoon of salt. Continue to cook until the onions are well browned, about 10 to 15 more minutes.
1 tsp sugar, 1 tsp salt
Add the minced garlic and cook for a minute more.
10 g garlic