Mix mayonnaise, ketchup, and garlic powder in a small bowl and set aside.
Divide ground beef into 4 loose balls without compacting, season with salt and pepper, and top each ball with a small pile of sliced onions.
Heat a cast iron skillet or griddle over high heat, place beef balls onion-side down, and immediately smash flat with a sturdy spatula, pressing onions into the beef.
Cook for 3 minutes until edges are crispy and onions are caramelized, flip once, and cook for 2 more minutes until beef reaches 160°F / 71°C.
Add cheese slices in the last 60 seconds and cover the pan to melt.
Toast burger buns cut-side down in the same pan for 1 to 2 minutes until golden.
Spread sauce on bottom bun, add patty with onions and cheese, top with bun, and serve immediately.