Preheat oven to 350°F.
On the stovetop, melt 3 TBSP of butter over medium heat. Add onion and cook, stirring, until onion is tender. Add flour, pepper & salt. Stir constantly until bubbly and smooth. Remove from heat and stir in milk. Put back on the heat and stir until the mixture boils. Boil for 1 minute, stirring constantly.
Spray a 2-quart casserole with cooking oil. If desired, peel potatoes. Slice potatoes thinly. Mix potatoes and cubed ham in the casserole dish. Press gently to flatten the top surface.
Pour the sauce over the potato mix. Cut the remaining 1 TBSP of butter into small pieces and drop evenly on top of the casserole.
Cover the casserole and bake for half an hour. Then, uncover and bake for an additional 1 hour or until the potatoes are soft and tender.
Tip: The sauce will thicken if you let it stand 10 minutes.
Image source: YouTube