Preheat oven to 350 degrees F (175 degrees C). Grease a 9x13 inch baking dish.
Melt butter in a large saucepan over medium heat. Cook and stir onion in the melted butter until the onion is tender, about 5 minutes. Stir in flour, salt, and pepper; cook for 1 minute.
Slowly stir in milk and continue to cook and stir until the sauce thickens, about 5 minutes. Stir in ham and cheese, stirring until the cheese is melted.
Pour the mixture into the prepared baking dish. Pour the eggs over the top and mix lightly into the casserole.
Bake in the preheated oven for 25 minutes, or until the eggs are set and the top is golden brown.
Interesting Facts
This casserole is a great way to use up leftover ham.
The dish is very versatile; you can add other ingredients, such as mushrooms, peppers, or other vegetables.
This dish can be served as a main course or an appetizer.