Preheat the oven to 350°F (177°C).
Grease the 8.5" x 8.5" baking dish.
Begin layering the potatoes and onions into the baking dish, starting and ending with the potatoes. Sprinkle each layer of potatoes with salt and pepper. (See video.)
In a measuring cup, mix the egg into the milk until well incorporated.
Cook's Note: Although not in the original recipe, I recommend adding 1 tablespoon of all-purpose flour to the milk and egg mixture. Whisk well until the flour is completely incorporated.
Pour the milk and egg mixture into the baking dish over the potatoes and onions.
Dot the potatoes with small pieces of butter.
Place the bacon on top of the potatoes and butter.
Cover the baking dish with aluminum foil and bake on the middle rack of the oven for one hour.
After one hour, remove the foil and allow the casserole to continue baking for 15 minutes or until it is bubbly, the potatoes begin to turn golden brown, and the bacon sizzles.
Remove the casserole from the oven, allow it to cool slightly, and then serve.
Leftovers can be stored in the refrigerator in an airtight container for up to 3 days. Reheat uncovered in a 350°F (177°C) oven until warmed through.