Heat a large skillet over medium heat and add the olive oil, swirling to coat the pan. Once shimmering, add the thinly sliced onions and cook gently, stirring occasionally, until they soften and become translucent, about 10 minutes.
Sprinkle the sugar over the onions and continue cooking, stirring regularly. Let the onions caramelize slowly, developing a deep golden color and sticky texture, which takes about 20-25 minutes. Keep the heat moderate to prevent burning.
Remove the skillet from the heat and let the caramelized onions cool slightly, so they’re warm but not hot.
In a mixing bowl, combine the mayonnaise, softened cream cheese, and a pinch of salt and pepper. Whisk until smooth and creamy, creating a soft base for the dip.
Add the slightly cooled caramelized onions to the creamy mixture. Fold everything together until well incorporated, ensuring the onions are evenly distributed throughout the dip.
Taste the dip and adjust the seasoning with more salt or pepper as needed for your preference.
Transfer the dip to a serving bowl and serve immediately or refrigerate until ready to enjoy. The dip will have a thick, luscious consistency and a deep caramelized onion flavor.