Slice your onions into thin, even pieces—I aim for roughly 1/4-inch thickness so they cook uniformly and don't leave some pieces raw while others turn to mush. Even thickness matters because uneven pieces caramelize at different speeds, which honestly took me three attempts to figure out.
Heat olive oil in a large skillet over medium heat, then add the sliced onions with a pinch of salt and the sugar. The salt draws moisture from the onions, which helps them release liquid and eventually caramelize rather than just brown on the outside. I add sugar not to make them sweet but because it accelerates the Maillard reaction—the chemical process that builds that deep golden color and complex flavor.
Let the onions cook undisturbed for 8-10 minutes, then stir once and reduce heat to medium-low. This initial high-heat phase builds flavor fast, then the lower temperature prevents burning while deepening the color. I usually peek after 6 minutes because I get nervous, but resist the urge to stir constantly because that interrupts the caramelization process.
Continue cooking for another 20-25 minutes, stirring every 5 minutes, until the onions turn deep amber and smell almost nutty. You'll notice the onions reduce by about 75% in volume—this is correct and exactly what you want. At the 15-minute mark, I always taste a tiny piece to make sure they're sweetening properly, not just browning on the outside.
Remove from heat and let the onions cool for 5 minutes before adding them to your mixing bowl, because adding hot onions to cold sour cream can cause curdling. I learned this the hard way when the mixture looked grainy and broken, and I couldn't figure out what went wrong until someone told me the temperature shock matters.
In a separate bowl, whisk together sour cream, mayonnaise, lemon juice, Gruyère cheese, thyme, and parsley until no lumps remain. The whisking step matters because it helps the mayo and sour cream emulsify, which prevents separation later when people are dipping.
Fold the cooled caramelized onions into the cream mixture gently, then stir in the toasted pine nuts last. Folding instead of stirring vigorously keeps the texture light and prevents you from crushing the onion pieces into a paste. Top with a few extra pine nuts and a pinch of fresh parsley if you're serving this crowd favorite immediately.