Make sure the oven rack is in the center position and preheat the oven to 425ºF.
Place the potato nuggets in a 9 by 13-inch casserole dish and bake for 15 minutes. Using oven mitts or pot holders, carefully remove the dish from the oven and turn the Tater Tots with tongs. Return the dish to the oven and bake until crisp, about another 15 minutes. Using the mitts or pot holders, remove the dish from the oven.
Reduce the oven temperature to 375ºF.
In a medium, heavy saucepan, melt the butter over medium heat.
Add the onion, salt, and pepper, and cook until soft, about 4 minutes, stirring occasionally with a large wooden spoon.
Incorporate the ham and cook, stirring, for 2 minutes.
Add the flour and cook, stirring constantly, for 2 minutes.
Pour in the milk and bring to a boil, stirring frequently. Reduce the heat to medium-low and simmer, stirring occasionally, for 2 minutes, or until thickened.
Using the mitts or pot holders, remove the saucepan from the heat and add 2 cups of the cheese. Stir until thoroughly combined.
Pour the milk mixture over the Tater Tots and sprinkle with the remaining 1 cup of cheese.
Bake in the oven until bubbly and golden brown, about 35 minutes.
Using the mitts or pot holders, remove from the oven and let rest for 5 minutes before serving.