Preheat the oven to 375°F (190°C) and lightly coat a 9×13-inch baking dish with nonstick spray or oil.
Place a large skillet over medium-high heat. Add the ground beef and cook until fully browned, breaking it apart with a spatula as it cooks. Once no pink remains, transfer the meat to a bowl and discard any rendered fat.
In the same pan, warm the olive oil over medium heat. Add the chopped red onion and sauté for about 4 minutes, or until softened. Stir in the minced garlic and cook for an additional minute until fragrant.
Return the cooked ground beef to the skillet. Add the taco seasoning, diced green chilies (if using), and black beans. Pour in 1/2 cup of water, stir to combine, and let the mixture simmer briefly. If the filling seems too thick, add 1–2 more tablespoons of water. Remove from heat once evenly mixed and heated through.
To assemble, arrange 3 tortillas (each halved) and 1 whole tortilla to create a base layer in the prepared baking dish, ensuring the surface is fully covered.
Spread one-third of the salsa evenly over the tortillas. Spoon half of the meat mixture across the salsa layer. Dot the surface with half of the sour cream and gently spread it out. Sprinkle 1 cup of the shredded cheese on top.
Repeat the layering process: tortillas, salsa, remaining meat mixture, sour cream, and another portion of cheese.
Finish with a final layer of 4 tortillas, then spread the remaining salsa over the top and cover with the last of the shredded cheese.
Bake in the preheated oven for 30 to 40 minutes, or until the top is bubbly and the cheese is golden and melted.
Let rest for a few minutes before slicing and serving.