Preheat your oven to 375°F (190°C).
In a large skillet, cook the diced bacon over medium heat until crispy. Remove the bacon with a slotted spoon and set aside, leaving the bacon fat in the skillet.
In a large bowl, combine the grated potatoes and chopped onion.
In another bowl, whisk together the eggs, milk, flour, baking powder, salt, and pepper.
Add the egg mixture to the potato mixture and mix well.
Heat the vegetable oil or butter in the same skillet used for the bacon. Once hot, pour the potato mixture into the skillet. Spread it out evenly.
Transfer the skillet to the preheated oven and bake for 60-70 minutes, or until the kugelis is golden brown and cooked through. You can check for doneness by inserting a knife into the center; it should come out clean.
Remove from the oven and let it cool slightly before slicing and serving.
Enjoy your meal!