Heat oven to 400 degrees F. Grease a 9x13-inch baking dish.
Meanwhile, melt butter in large Dutch oven (or large, heavy-bottomed saucepan) over medium-high heat until foaming subsides, about 1 minute. Add onion and saute until it turns soft and begins to brown, about 4 minutes. Add garlic and saute until fragrant, about 30 seconds. Add cream, milk, thyme, bay leaves, salt, pepper, and potatoes and bring to a simmer. Cover, adjusting heat as necessary to maintain a light simmer, and cook until potatoes are almost tender (paring knife can be slipped into and out of center of potato slice with some resistance), about 15 minutes, gently stirring occasionally to ensure the potatoes don't stick to the bottom of the pot.
Remove and discard thyme sprigs and bay leaves. Transfer potato mixture to the prepared baking dish and sprinkle with cheese. Bake until the cream has thickened and is bubbling around sides and the top is golden brown, about 30 minutes. Allow to sit for 10 minutes before serving. Leftovers can be stored in an airtight container in the refrigerator for up to 4 days.
While I recommend russet potatoes as the best choice because they hold up well to all of that liquid, yellow or Yukon gold could be substituted if necessary, just be aware that the potatoes may break down a bit during cooking.
Other cheese, or a combination of others, can be used in place of the cheddar. Use what you love!
Make-Ahead Option #1: Prepare the sauce and potatoes, add to the casserole dish, then wrap tightly with plastic wrap or foil and refrigerate. This can be done up to two days in advance. When you’re ready to cook, sprinkle the cheese on top and bake as directed.
Make-Ahead Option #2: You can also follow the entire scalloped potatoes recipe the day before, then cool and refrigerate. Cover with a lid or wrap tightly with foil. Reheat by baking at 350 degrees for 25-30 minutes, or until sauce is bubbling and the dish is heated through. If you’re putting the pan in the oven straight from the fridge, it may take up to 45 minutes to reheat.
Freezing Instructions: Leave the cheese off of the top and bake for less than the recommended time, until the potatoes are al dente. Cool completely, then cover and refrigerate for at least 2 hours. Cover the pan with plastic wrap and aluminum foil and freeze for up to 1 month. Thaw in the refrigerator overnight, remove the plastic wrap, add the cheese, and bake at 400 degrees for 15 to 20 minutes.