Preheat oven to 350°.
Note: While the onions caramelize, measure out your remaining ingredients.
Soften/Caramelize the Onions: Cut the onions into ¼ inch strings. Melt 2 tbsp. butter and olive oil in a large skillet over medium-low heat. Add the onions and thyme. Let them cook slowly for about 30 minutes, until they’re brown and caramelized. Stir every few minutes. Once done, remove and set aside.
Combined Butter & Flour: Increase heat to medium. Add 4 tbsp. butter to the pot along with the garlic. Cook for 1 minute and use a silicone spatula to “clean” the bottom and sides of the pot. Add flour and whisk to incorporate. Continue to whisk for 1 minute or until you can no longer smell flour.
Add the Milk: Gradually add the milk, splashes at a time, and whisk to incorporate. If you add it too fast the roux will thin out too much. Bring to a boil, then remove from heat.
Add Seasonings: Add mustard powder, salt, pepper, and cayenne. Stir to combine.
Add Cheese: Let the roux cool down a bit. Reserve 1 heaping cup of cheddar cheese and gradually sprinkle the rest in. If the base is too hot when the cheese is added, the dairy will separate and the sauce will be grainy
Stir in cream cheese, then add the caramelized onions.
Slice the potatoes: Peel the potatoes, rinse, and pat dry. Cut them into thin and even slices, about 1/8 inch thick. (See post for visual.)
Fill the Casserole Dish: Arrange half of them on the bottom of a lightly greased 9 x 13-inch baking dish and top with half of the cheese sauce. Add remaining potatoes and remaining cheese sauce. Top with remaining cheddar cheese.
Bake: Cover and bake at 350° for 45 minutes. Remove cover and bake for 35-40 more minutes, until the potatoes are fork tender.
Optional: Broil at 400° until the top is slightly browned, don't walk away. Let sit for 5-10 minutes, garnish with fresh parsley, and serve.