01 - Preheat the oven to 375°F. Lightly grease a 9x13-inch baking dish.
02 - In a skillet set to medium heat, sauté the finely chopped onion for 3 to 4 minutes until softened. Add minced garlic and cook for an additional minute.
03 - In a large mixing bowl, combine shredded chicken, sautéed onions and garlic, black beans, corn, and 1/2 cup of the enchilada sauce. Mix thoroughly.
04 - Spread 1/2 cup enchilada sauce evenly on the bottom of the prepared baking dish. Arrange half of the tortillas over the sauce, overlapping as necessary.
05 - Distribute half of the chicken mixture over the tortillas. Sprinkle with 1 cup shredded cheddar cheese and 1/2 cup shredded Monterey Jack cheese.
06 - Layer the remaining tortillas, followed by the remaining chicken mixture, then top with the remaining shredded cheddar and Monterey Jack cheeses.
07 - Pour the remaining enchilada sauce evenly across the top layer.
08 - Cover the dish with foil and bake for 25 minutes.
09 - Remove the foil and continue baking for an additional 10 minutes until the cheese is bubbly and golden brown.
10 - Let the casserole rest for 10 minutes before garnishing with chopped cilantro and sliced green onions. Serve with sour cream and lime wedges if desired.