Preheat your oven to 400°F and lightly grease a 9x13 inch baking dish or similar size. While the oven heats, peel and slice the potatoes into 1/8-inch rounds—I use a mandoline for consistent thickness, which helps them cook evenly. Rinse the sliced potatoes in cold water to remove excess starch, then pat them completely dry with paper towels; this prevents a gluey texture. Mince the garlic cloves finely. Measure out all remaining ingredients so everything is ready when you start building the sauce.
Melt the butter in a medium skillet over medium heat, then add the minced garlic and cook for about 1 minute until fragrant—don't let it brown or it will become bitter. Sprinkle the flour over the butter and garlic, stirring constantly for 1 to 2 minutes to cook out the raw flour taste and create a roux. Pour in the stock, add the thyme, 1 teaspoon salt, pepper, and nutmeg, stirring well to combine and breaking up any lumps. Simmer this mixture for about 3 minutes to thicken slightly.
Slowly whisk the room-temperature milk into the simmering sauce, stirring constantly for about 5 minutes to ensure it thickens evenly and no lumps form. Once the sauce has thickened and coats the back of a spoon, remove from heat and stir in 1 cup of the sharp cheddar cheese until completely melted and smooth. I always use sharp cheddar here because it provides much more flavor depth than mild varieties—the difference is noticeable in the final dish.
Spread about one-third of the sliced potatoes evenly across the bottom of the prepared baking dish. Sprinkle with 1/2 teaspoon salt, then pour one-third of the cheese sauce from Step 3 evenly over the potatoes. Repeat this layering process twice more—potatoes, 1/2 teaspoon salt, and sauce—until all potatoes and sauce are used, ending with sauce on top. This even distribution ensures every bite has creamy, flavorful sauce throughout.
Sprinkle the remaining 1 cup of sharp cheddar cheese evenly over the top layer, then cover the baking dish tightly with foil. Bake at 400°F for 35 minutes—the foil traps steam and helps the potatoes cook through without the top browning too quickly. Remove the foil and continue baking for another 40 minutes until the top is golden brown and the potatoes are completely tender when pierced with a fork.
Remove the scalloped potatoes from the oven and let them rest for 15 minutes before serving—this allows the sauce to set slightly so it won't run all over the plate. Top with a light sprinkling of fresh thyme and cracked black pepper just before serving for a fresh herb finish and visual appeal.