Preheat the oven to 350°F. Lightly grease a 9-inch baking dish with oil or 1 tsp of bacon grease. Peel and finely grate the potatoes, then finely grate the onion.
If the grated potatoes are very watery, gently squeeze out excess liquid over a bowl using a cheesecloth or a clean kitchen towel. Let the liquid sit to separate, then pour out the liquid and add the starch back to the potatoes.
Bring the milk to a simmer, then carefully pour it over the grated potatoes and onions. The mixture should be fairly loose and creamy. Add the egg, salt, black pepper, and mayonnaise to the potatoes. Mix well until everything is fully combined.
Pour the mixture into the prepared baking dish.
Bake for 50 minutes to 1 hour (depending on the thickness) until the top is golden and the kugelis is set. Top with bacon and enjoy!