Preheat the Oven: Preheat your oven to 375°F (190°C). Lightly grease a 9×13 inch baking dish with butter or non-stick cooking spray.
Prepare the Potatoes: Peel the potatoes and carefully slice them into thin rounds, approximately 1/8 inch thick. A mandoline slicer is highly recommended for even slices. Set the potatoes aside.
Sauté the Aromatics: Melt the unsalted butter in a medium saucepan over medium heat. Add the finely diced onion and cook for 3 to 4 minutes until soft and translucent. Stir in the minced garlic and cook for an additional 30 seconds until fragrant.
Create the Roux: Sprinkle the all-purpose flour over the onion and garlic mixture. Whisk constantly for 1 full minute to cook out the raw flour taste.
Build the Cream Sauce: Slowly pour the milk into the saucepan, whisking continuously to prevent any lumps from forming. Continue to cook and whisk until the sauce thickens slightly, about 3 to 5 minutes.
Add the Cheese and Seasoning: Remove the saucepan from the heat. Stir in 1 cup of the shredded cheddar cheese, the salt, black pepper, and paprika. Stir until the cheese is completely melted and the sauce is smooth.
Assemble the First Layer: Arrange half of your prepared potato slices in an even layer at the bottom of the prepared baking dish. Pour exactly half of the cheese sauce evenly over the potatoes.
Add the Second Layer: Arrange the remaining potato slices on top of the first layer. Pour the rest of the cheese sauce evenly over the top, ensuring all potatoes are coated.
Top with Remaining Cheese: Sprinkle the remaining ½ cup of cheddar cheese and the ½ cup of mozzarella (or Gruyère) evenly over the top of the casserole.
Bake Covered: Cover the baking dish tightly with aluminum foil. Bake in the preheated oven for 40 minutes.
Bake Uncovered: Remove the foil and bake for an additional 15 to 25 minutes. The potatoes are done when they are fork-tender and the cheese topping is golden brown and bubbly.
Rest and Serve: Remove the dish from the oven and let it rest for at least 10 minutes before serving. This allows the creamy sauce to thicken and set. Garnish with fresh chopped parsley if desired.