Preheat your oven to 400°F. Spray a 2-quart baking dish with olive oil.
Heat the olive oil in a large skillet over medium-high heat for about 2 minutes. Add the beef and the onions. Cook, stirring to break up the beef until the meat is browned and the onion is soft, for about 5 minutes.
If there are liquids at the bottom of the skillet, carefully drain the mixture and return it to the skillet.
Stir in the kosher salt, black pepper, and garlic. Cook, stirring, for 1 more minute.
Turn the heat off. Stir in the mayonnaise, unsweetened ketchup, mustard, and 1 cup of shredded cheddar.
Transfer the mixture to the prepared baking dish. Sprinkle with the remaining cheese.
Bake until the cheese is melted and the casserole is heated through, for about 15 minutes. Alternatively, if your baking dish is broiler-safe, broil the casserole 6 inches below the heating element (not directly below) until the cheese is melted, 1-2 minutes.
If you'd like to turn this casserole into a complete meal, you can add 1-2 cups of uncooked riced cauliflower to the ground beef/onion and cook everything together. You'll need to increase the olive oil by 1-2 tablespoons.You can keep the leftovers in the fridge, in an airtight container, for 3-4 days. Reheat them gently, in the microwave, at 50% power. You can also freeze individual servings for up to three months.