Combine ground beef and onions in a large skillet over medium-high heat; cook and stir until browned, about 5 to 7 minutes; drain excess fat.
Arrange 1 can of chile peppers on the bottom of a 7x11-inch baking dish. Sprinkle with half of the cheese and top with meat mixture. Sprinkle meat mixture with remaining cheese, followed by next can of chile peppers.
Combine eggs, flour, and milk in a medium bowl, whisking until smooth; pour into baking dish over chile peppers. Season with salt and pepper to taste.
Bake in the preheated oven for 45 to 50 minutes. Let cool briefly before serving.
