3 tablespoons butter
1 small white or yellow onion, peeled and thinly sliced
4 large garlic cloves, minced
1/4 cup all-purpose flour
1 cup chicken stock or vegetable stock
2 cups milk (I recommend 2% or whole milk)
1 1/2 teaspoons Kosher salt
1/2 teaspoon black pepper
2 teaspoons fresh thyme leaves, divided
4 pounds Yukon Gold Potatoes, sliced into 1/8-inch rounds
2 cups freshly-grated sharp cheddar cheese*, divided (feel free to add more cheese if you’d like)
1/2 cup freshly-grated Parmesan cheese, plus extra for serving
Preheat oven to 400°F. Grease a 9 x 13-inch baking dish with cooking spray; set aside.
Melt butter in a large sauté pan over medium-high heat. Add onion, and sauté for 4-5 minutes until soft and translucent. Add garlic and sauté for an additional 1-2 minutes until fragrant. Stir in the flour until it is evenly combined, and cook for 1 more minute. Gradually pour in the stock, and whisk until combined. Add in the milk, salt, pepper, and 1 teaspoon thyme, and whisk until combined. Continue cooking for an additional 1-2 minutes until the sauce just barely begins to simmer around the edges of the pan (avoid letting it come to a boil) and thickens. Then remove from heat and set aside.
Spread half of the sliced potatoes in an even layer on the bottom of the pan. Top evenly with half of the cream sauce. (I usually strain out all of the onions and add them here too.) Then sprinkle evenly with 1 cup of the shredded cheddar cheese, and all of the Parmesan cheese. Top evenly with the remaining sliced potatoes, the other half of the cream sauce, and the remaining 1 cup of cheddar cheese.
Cover the pan with aluminum foil and bake for 30 minutes. The sauce should be nice and bubbly around the edges. Then remove the foil and bake uncovered for 25-30 minutes, or until the potatoes are cooked through.
Transfer the pan to a cooling rack, and sprinkle with the remaining teaspoon of thyme and extra Parmesan. Serve warm.