Preheat your oven to 350°F (175°C).
In a large skillet over medium heat, brown the ground beef. Drain excess fat.
Stir in the diced onion and minced garlic. Cook until the onion is translucent, about 3-4 minutes.
Add chili powder, cumin, salt, and black pepper to the beef mixture, stirring to combine.
Add the black beans and corn to the skillet, mixing well. Pour in half of the enchilada sauce and stir to combine.
Spread a thin layer of the remaining enchilada sauce on the bottom of a 9x13 inch baking dish.
Place four tortillas over the sauce, slightly overlapping as needed.
Spoon half of the beef mixture over the tortillas, spreading it evenly.
Sprinkle one cup of shredded cheese over the beef mixture.
Add another layer of tortillas, the remaining beef mixture, and another cup of cheese.
Place the last four tortillas on top and pour the remaining enchilada sauce over them. Top with the remaining cheese.
Cover the casserole with aluminum foil and bake for 20 minutes. Remove the foil and bake for an additional 10-15 minutes, or until the cheese is bubbly and golden.
Let the casserole cool for a few minutes before slicing. Garnish with fresh cilantro if desired.