4 Tbsp. (½ stick) butter, plus more for baking dish
1 yellow onion, finely chopped
2 garlic cloves, minced
¼ cup all-purpose flour
1 tsp. kosher salt
½ tsp. ground pepper
3 cups milk, warmed to 110°F to 120°F
4 pounds russet potatoes, peeled and cut into ½-inch slices
½ cup chopped parsley, plus more for garnish
1 cup grated Gruyère, Jarlsberg or Swiss cheese

1. Preheat oven to 350°F. Butter a 9-by-13-inch pan or 2-quart baking dish.

2. Melt the butter in a small saucepan over medium heat. Add the onions and cook until softened and beginning to brown, about 10 minutes. Add the garlic and cook for 1 minute more. Stir in the flour, salt and pepper and cook for 1 minute. Add the milk, ½ cup at a time, and simmer until the mixture begins to thicken, about 5 minutes. Remove from the heat.

3. Spread the potatoes in an even layer in the prepared pan and sprinkle with the parsley. Pour the milk mixture over the potatoes, then sprinkle with the cheese. Cover with aluminum foil.

4. Bake for about 25 minutes, until beginning to bubble. Remove the cover and bake for 20 to 30 minutes more, until the potatoes are very tender and the cheese is browned and bubbly.

5. Serve immediately, or cover and keep warm for up to 1 hour.