01 - Preheat oven to 375°F. Lightly grease a 9x13-inch baking dish.
02 - Heat olive oil in a large skillet over medium heat. Add chopped onion and sauté for 2 to 3 minutes until softened.
03 - Stir in shredded chicken, black beans, corn, cumin, chili powder, garlic powder, salt, and black pepper. Cook for 2 to 3 minutes until heated through, then remove from heat.
04 - Spread ½ cup enchilada sauce evenly on the bottom of the prepared baking dish.
05 - Place 4 corn tortillas over the sauce, tearing them to fit the dish as needed.
06 - Layer half of the chicken mixture over the tortillas. Drizzle with ½ cup enchilada sauce and sprinkle 1 cup shredded cheese on top.
07 - Place remaining 4 tortillas over the filling, followed by the remaining chicken mixture, ½ cup enchilada sauce, and 1 cup shredded cheese.
08 - Pour the remaining ½ cup enchilada sauce evenly over the top and cover loosely with aluminum foil.
09 - Bake for 20 minutes, then remove foil and continue baking for another 10 to 15 minutes until the cheese is bubbly and golden.
10 - Let rest for 10 minutes before slicing. Garnish with cilantro, sour cream, sliced avocado, and lime wedges if desired.