Follow the steps in order for the best result.
In a saucepan, melt the margarine over medium heat. Whisk in the flour and cook for about 1 minute, until smooth.
Gradually whisk in the chicken broth (or water), ensuring there are no lumps. Continue whisking until the mixture begins to bubble and thicken.
Remove from heat and stir in the mayonnaise, salt, and white pepper until well combined. Set aside.
Thinly slice the potatoes. A mandoline slicer is highly recommended for uniform slices.
In a large bowl, combine the sliced potatoes and chopped onion, mixing well to distribute the onion evenly.
Transfer the potato and onion mixture to a deep, oven-safe baking dish.
Pour the prepared sauce evenly over the potatoes, ensuring they are well coated.
Sprinkle the top generously with paprika for color and flavor.
Bake in a preheated oven at 350°F (175°C) for approximately 1 hour and 30 minutes, or until the potatoes are tender and easily pierced with a fork.