Slowly Caramelize the Onions: Heat 2 tablespoons of olive or avocado oil in a large skillet over medium heat. Add the sliced onions and sprinkle lightly with salt. Cook gently for about 5 to 7 minutes, stirring occasionally, until the onions soften and start to turn golden. Reduce the heat to low and continue cooking, stirring every few minutes, until the onions are deeply browned, tender, and sweet—this should take about 20 to 25 minutes. Once done, remove from heat and set aside.
Shape and Season the Beef Patties: Divide the ground beef into four equal portions. Gently form each into a patty about ¾ inch thick, taking care not to overwork the meat. To help prevent the patties from puffing up during cooking, press your thumb lightly into the center of each. Season both sides generously with salt and freshly cracked pepper.
Cook the Beef Patties: In a separate heavy-bottomed cast iron or carbon steel skillet (or a griddle), warm the remaining 2 tablespoons of oil over medium heat. Place the patties in the hot pan and cook for 5 to 7 minutes per side for medium doneness, adjusting the time according to your preferred level of cooking (use a meat thermometer if possible). When there are 2 to 3 minutes left, place a slice of Swiss cheese on each patty and let it melt. Once cooked, transfer the patties to a plate and let them rest briefly.
Sauté the Mushrooms and Create Sauce: Using the same pan where you cooked the burgers (with the rendered beef fat), add the sliced mushrooms. Season with a pinch of salt and sauté over medium-high heat for about 5 to 7 minutes, stirring occasionally, until the mushrooms are golden brown. Add the minced garlic and cook for an additional minute. Pour in the beef broth and raise the heat to high. Let the mixture simmer until the liquid reduces by half and thickens into a rich sauce, about 5 minutes. Taste and adjust seasoning with salt and pepper. Stir in the optional butter and sprinkle chopped parsley for extra flavor and gloss.
Toast the Buns: To prevent sogginess and add a crisp texture, toast the hamburger buns separately. Brush the cut sides with garlic butter or a little oil, then toast on a hot skillet or grill pan until golden brown.
Assemble the Burgers: Start with the toasted bottom bun, place the rested beef patty with melted cheese on top, layer a generous spoonful of the caramelized onions, then add the savory mushroom sauce with mushrooms. Finish by placing the top bun on the burger. Serve immediately and enjoy!