Preheat the oven: Preheat the oven to 350°F. Lightly spray a 9×13-inch casserole dish with cooking spray.: : Warmth in the kitchen signals progress, and when the oven reaches 350°F you will notice a gentle steady hum from the heating elements. The air becomes dry and slightly warming to the touch as the cavity stabilizes, which is important so the casserole begins to cook evenly the moment it goes in. I always let the oven fully reach temperature instead of guessing, because slipping a cold dish into an oven that is still climbing can lengthen the bake time and affect the final texture. A common mistake is rushing this step, which leads to a longer overall cook and uneven browning; give the oven those extra minutes to come to temperature.
Sauté onion and garlic: In a medium size skillet, melt the butter over medium low heat. Add the onion and garlic and cook for about 3 minutes until softened. Sprinkle the flour over the onion and garlic and stir. Cook for 2 more minutes.: : As the butter melts over medium low heat you will hear a gentle sizzle and smell a toasty, nutty aroma from the fat as it warms. When you add the chopped onion and minced garlic , their scent blossoms into a sweet, aromatic base. Softening for about 3 minutes until the onion becomes translucent is the visual cue you want, and the mixture should shimmer without browning. Sprinkling the flour and stirring creates a slightly sandy paste that will lose its raw taste after a short cook of about 2 minutes. If you let the aromatics color, they will shift toward caramelized flavors which alter the intended delicate sauce profile; monitor the heat and stir frequently to avoid burning.
Make the sauce: Slowly add the chicken broth and milk while continuously whisking to thicken. Whisk until smooth. Bring to a boil over medium heat while continuing to whisk. Season with salt and pepper.: : When you slowly add the chicken broth and milk while whisking, the mixture transforms from a thick paste into a glossy, homogeneous sauce; you will see ribbons form as the whisk moves and hear a soft thickening bubble as it approaches a simmer. Bring the sauce to a gentle boil over medium heat while continuing to whisk so it does not stick or develop lumps, and season with salt and pepper to taste. The goal is a smooth sauce that coats a spoon, not an aggressively thick gravy; this allows it to seep between the potato slices. A frequent error is adding the liquid too quickly, which results in lumps and requires extra whisking to correct, so pour slowly and keep the whisk moving.
Layer the ingredients: Layer about a pound of the potato slices on the bottom of the prepared casserole dish. Top evenly with 1/3 of the sauce and about 1/2 cup of cheddar cheese. Repeat with another layer of potatoes, 1/3 of the sauce, and 1/2 cup of cheddar, the rest of the potatoes, remaining sauce, remaining cheese and finally the Parmesan cheese.: : Layering is tactile and visual, and placing about a pound of the potato slices on the bottom creates an even base. As you top with roughly one third of the sauce and about 1/2 cup of shredded white cheddar cheese , you will see the sauce glisten and the cheese begin to sink slightly into the layers. Repeat this process so each strata receives its fair share of sauce and cheese, finishing with the remaining sauce and the grated Parmesan cheese on top; the finished assembly should look evenly distributed and slightly glossy. Uniform slices are crucial here, because uneven pieces lead to irregular doneness; use consistent thickness for dependable results. Avoid heaping all the potatoes in once and pouring sauce on top, because that prevents even coating and can leave pockets of dry potato.
Bake: Cover the casserole dish with aluminum foil and bake for about 45 minutes. Remove the aluminum foil and bake for an additional 45 minutes or until golden brown and the potatoes are fork tender. If needed, broil for a couple minutes until golden brown to your preference.: : Cover the casserole with foil to trap steam and allow the potatoes to become tender without drying out; during the first 45 minutes the kitchen will fill with savory steam and gentle bubbling sounds under the foil. After removing the foil and baking for an additional 45 minutes, the top will begin to brown and you will hear a pleasant soft bubbling as the sauce reduces into the layers. Look for golden color and fork tender potatoes as visual cues, and if you desire extra color, briefly broil for a couple minutes until the surface is golden and slightly crisp. A typical mistake is overbaking under foil or failing to remove it for the final bake, which can prevent a golden crust; time and visual checks prevent this.
Garnish and serve: Garnish with fresh chopped thyme and serve with your favorite meat dish.: : After the gratin rests a few minutes out of the oven, sprinkle the chopped fresh thyme across the top so its aroma perfumes each bite. The steam will carry herb notes, and the contrast of green against the golden surface makes the dish look inviting. Serve while warm so you capture the creamy texture and molten cheese ribbons, and pair with a simple protein or a crisp salad if you like. A common oversight is slicing into the gratin immediately; letting it rest briefly helps the sauce set for cleaner serving portions.