There's arguably a different version of pasta e fagioli, the classic Italian bean and pasta soup, for every region, province, and household of Italy, and every Italian (and some non-Italian) households outside of Italy, too. There are brothy ones, tomatoey ones, creamy ones, abundant ones chock-full of vegetables, austere ones with little more than pasta and beans, garlicky ones, winey ones, spicy ones, meaty ones, cheesy ones, vegan ones, and on and on. That kind of variation can be maddening, but it also makes the dish an excellent case study.
A couple of years ago, Kenji published another pasta e fagioli recipe, the focus of which was how to make canned beans work in a quick version of the dish. As he explained then, canned beans have a lot going for them—namely, they're convenient and quick and have great texture. What they don't have is a particularly good flavor.
His solution was to make a brothy, flavor-packed pasta e fagioli to compensate for what the beans lacked. He added tomatoes, plenty of garlic and onion, red pepper flakes, chicken stock, bay leaves, oregano and parsley, and even used three different fats (pancetta, olive oil, and butter). It's exactly what you should do when cooking with canned beans, because they can't carry the show by themselves.
I point it out because today I want to contrast it with another recipe that is pretty much on the opposite end of the pasta e fagioli spectrum. This one has only two main ingredients: beans and pasta. Its success lives or dies by the quality of those beans. Canned beans, therefore, should not be used in this soup—only dried beans will do here. Get nice beans that haven't been sitting on a shelf for years and cook them properly, and you'll unlock the beauty of what a bean can be. Use really old beans and cook them poorly, and the soup will suffer.
Don't be scared off by this warning: It's very easy to cook beans well. Whether you simmer them in a pot for an hour or two or use a pressure cooker to speed things up, the key to is cook them with lots of aromatics. Plenty of onion and garlic should go into the pot; some carrot and celery added to it will be even better. Woodsy herbs like fresh rosemary or sage are essential. And salt, contrary to popular belief, will not interfere with the beans cooking properly (in fact, they cook better with salt added); add it to the pot right at the beginning so that the beans will be seasoned throughout.
In essence, you want the beans to simmer in what is basically a very simple vegetable stock. The results are deeply flavorful beans, along with bean-cooking water that tastes like a heck of a lot more than just beans. That's important, because the bean-cooking water is the liquid component of this soup.
As for the type of bean, many types can work. Here I'm using the speckled cranberry beans (also known as borlotti or romano beans), but white beans like cannellini or navy would work wonderfully, as would chickpeas.
One more note on cooking the beans: You are far better off overcooking the beans than undercooking them. That is true of all bean dishes, but it's especially true here. You want the beans to be completely soft and creamy, and it is absolutely worth risking some rupturing to guarantee that none are firm or grainy.
With the beans cooked, the rest of the soup couldn't be simpler: purée most of the beans with some bean-cooking liquid to make a smooth, creamy soup base, then add the remaining whole beans for texture.
Now to the pasta: One of the worst things that can happen with pasta e fagioli is that the pasta becomes bloated and waterlogged in the soup. The solution is to borrow a restaurant trick by cooking the pasta separately and only adding it at the last minute, just long enough to warm through before serving.
If I make a large batch or have leftovers, I refrigerate the pasta and soup separately, combining only as much as I need for the portions I'm reheating. To keep the pasta from sticking to itself, I just toss it with a tiny bit of olive oil.
To finish, I grind some black pepper on top and drizzle some good olive oil all over.
Between this recipe and Kenji's, you pretty much have the two ends of the pasta-e-fagioli spectrum. They're both great recipes, but the best part may well be all the infinite possibilities that exists between them. Make one, then the other, then feel free to play with ideas from both. Maybe you'll stumble upon your own family recipe to pass down through the generations.