In a large saucepan, combine the beans, anchos and 2 quarts of water and bring to a boil over moderate heat. Lower the heat, cover partially and simmer until the beans are very tender, about 2 hours. Add a little water if necessary to keep the beans just covered as they cook; let cool. Working in batches, puree the beans and their liquid in a food processor.
Heat the oil in a large heavy skillet. Add the bacon and cook over moderately high heat without browning until the fat is rendered, about 5 minutes. Add the onion and garlic and sauté until deep golden brown, about 10 minutes. Lower the heat to moderate, add the pureed beans and stir until thick and creamy, about 5 minutes; if the beans become dry, stir in a little water. Season with salt.
Spread half of the beans in a large ovenproof skillet or baking dish and sprinkle with half of the grated cheese. Cover with the remaining beans and cheese and then the sliced jalapeños.
Preheat the oven to 350°. Bake the beans for about 20 minutes, or until they are heated through and the cheese is melted. Serve with tortilla chips or tortillas.
The beans can be covered and refrigerated in the skillet overnight. Let return to room temperature before proceeding.