Make the sauce:
Mix together the mayo, ketchup, pickles, mustard, sugar, and chili flakes in a small bowl; chill until ready to use.
Cook the onions:
Heat 1 ½ tablespoons of the oil in a 12-inch heavy skillet over medium heat. Add the onions and cook, stirring, until lightly golden, 8-9 minutes. Transfer to a small bowl and set aside.
Make the burgers:
In the same skillet, heat 1/2 tablespoon of the oil over medium-high heat. In a bowl, gently combine the beef, salt, and pepper; divide into four equal-sized balls. Working in batches if necessary, add the balls to the pan, leaving room for the diameter of tortillas that will cover them, then cover each ball with a tortilla and smash with a smashburger press or other flat, heavy item until the burger diameter almost equals the tortilla it is attached to. Cook 2-3 minutes, flip, add a slice of cheese on top of each burger, cover, and cook for another minute until the tortilla underside is crisped and the cheese on top is melted, 1-2 minutes. Remove the burgers to a platter and top each with some of the shredded lettuce, tomatoes, cooked onion mixture, and pickles. Top with burger sauce to taste.