Heat the oil in a large frying pan over medium heat until shimmering. Add the onions, season with salt, and cook until starting to soften, about 10 minutes. Cover and continue to cook, stirring every 5 minutes, until the onions are dark golden brown, 40 to 45 minutes more. Meanwhile, heat the oven and make the sauce.
Arrange 2 racks to divide the oven into thirds and heat to 425ºF. Coat 2 rimmed baking sheets lightly with oil and set aside. Stir the mayonnaise, ketchup, sweet pickle relish, mustard, and vinegar together in a medium bowl until combined.
About 20 minutes before the onions are ready, divide the fries between the baking sheets and spread into an even layer. Bake until the fries are light golden brown and crisp, stirring the fries halfway through and switching the baking sheets between racks, about 25 minutes total or according to package directions.
Season the fries with salt. Pile the fries onto 1 of the baking sheets, arranging them so they sit in about 2 layers. Place the cheese in a single layer over the fries. Bake on the upper rack until melted, about 1 minute. (At this point, you can slide the cheese fries onto a serving platter if you don’t want to serve them directly on the baking sheet.) Sprinkle the onions over the cheese and drizzle with the sauce. Serve immediately.
