Heat the oven to 375°F and grease a 9-by-13-inch baking dish with 1 tablespoon of the butter.
Melt the remaining butter in a saucepan, whisk in the flour for 1 minute, then gradually whisk in the milk, salt and pepper.
Simmer the sauce for 4 minutes until slightly thickened but still pourable.
Layer half the potatoes and onions in the dish, cover with half the sauce, and repeat the layers.
Cover with foil and bake for 55 minutes, then uncover and bake for 25 to 30 minutes until browned and a knife slides through the center without resistance.
Rest for 15 minutes before scooping so the sauce stays with the potatoes.