Mix mayonnaise, ketchup, and garlic powder in a small bowl and set aside.
Divide ground beef into 4 loose balls without compacting, then press a handful of sliced onions onto the top of each ball.
Heat a cast iron skillet or griddle over high heat, place each beef ball onion-side down, and immediately smash flat with a sturdy spatula, seasoning the exposed beef side with salt and pepper.
Cook for 2 to 3 minutes until the onions are caramelized and the edges are crispy, flip once, and cook for another 2 minutes until the internal temperature reaches 160°F / 71°C.
Place one cheese slice on each patty, cover the pan for 60 seconds to melt, then remove patties and toast the buns cut-side down in the same pan for 1 to 2 minutes until golden.
Spread sauce on the bottom bun, add the patty with onions and cheese, top with the bun, and serve immediately.