Use a heavy bottom pan with a lid. Heat it on medium and then coat the bottom with olive oil. Add onions, shallots, garlic, and a few shakes of salt. Gently stir, then top with butter and cover. Stir every 5-8 minutes, using a wooden spatula.
When you notice the first signs of caramelization (brown bits forming at the bottom), add sherry, brandy, bay leaves, nutmeg, and thyme. Add a few shakes of salt and pepper. Stir, change the heat to medium low, then leave uncovered from here on out.
The onions will cook for another 30 minutes and will need stirring every 5. Stirring too frequently won’t allow the onions to caramelize, but keep an eye on them to not burn. If you notice some browning sticking to the pan, deglaze with a couple tablespoons of water (can use dry white wine or beef stock if preferred). If you need to step away for a longer time, move to the heat to low. Once caramelized to your liking, take off the heat and let cool.
To make the dip, mix the onions, sour cream, and chives if using. I like to remove 1-2 teaspoons of onion before mixing and set it aside to be able to garnish on top. Once the dip is all mixed, do a taste test with the chips you plan to serve with to make sure the dip is salted enough. You may need another 1-2 teaspoons here. When satisfied with seasoning, add the remaining onion pieces and any additional chives or pepper flakes to garnish.
You can prepare the onions days in advance, and you can prepare the entire dip a day in advance of serving. This recipe can be easily doubled (or tripled) in which case a pot will be easier than a pan.
You can make this up to 3 days in advance. If the same day, let the onion mix cool in the fridge for at least 30 minutes before mixing with sour cream