Heat the oven to 350°F. Spray a 9x13-inch baking dish with cooking spray.
For the sauce, heat the oil in a large skillet over medium heat. Add one diced onion and the kosher salt and cook for about 5 minutes, until translucent.
Meanwhile, brown the ground beef in a second skillet, breaking it up and seasoning with the salt and pepper. Add the second diced onion and cook for about 5 minutes, until the beef is cooked through.
Stir the chili powder and cumin into the onion for the sauce and cook for about 30 seconds. Stir in the flour, then slowly whisk in the chicken stock. Add the tomato sauce and garlic, bring to a simmer and cook for 5 minutes, stirring now and then.
Take the beef off the heat, drain the fat, and stir in the green chiles and black beans.
Blend the sauce until smooth if you like. Spread 1/2 cup in the bottom of the baking dish and stir 1/2 cup into the beef mixture.
Dip 6 tortillas in the remaining sauce to coat and use them to line the bottom of the dish. Top with half the beef mixture and 1 cup of the cheese.
Dip the other 6 tortillas in the sauce and layer them on top, followed by the rest of the beef mixture and the remaining 2 cups of cheese.
Bake uncovered for 20 minutes, until the cheese is bubbling.