Preheat the oven to 375°F and lightly grease a 9×13 inch baking dish.
In a medium saucepan, melt the butter over medium heat. Add the chopped onion and cook for 3-4 minutes until soft. Add the garlic and cook for another 30 seconds.
Add the flour and whisk for 1 minute to form a roux.
Gradually add the milk and heavy cream while whisking. Continue whisking until the sauce is smooth and slightly thickened.
Stir in 1 ½ cups of the shredded cheddar cheese along with the salt, black pepper, and paprika until the cheese has melted and the sauce is smooth. Set aside.
Place half of the sliced potatoes in the prepared baking dish. Top with half of the diced ham and half of the cheese sauce. Repeat with the remaining ingredients.
Cover the baking dish with aluminum foil and bake for 45 minutes.
Uncover the casserole and top with the remaining ½ cup of shredded cheddar cheese. Bake for another 15-25 minutes or until the potatoes are fork-tender and the top is golden.
Let the casserole sit for 10-15 minutes before serving to allow the sauce to thicken slightly.