Set a saucepan over moderate heat. Drizzle in the olive oil and add the pancetta and garlic. Cook until crispy and browned.
Drain and rinse one of the cans of beans. Add to the pan along with the entire contents of the second can of beans. Season with a large pinch of salt and pepper. Stir in the stock, crushed red pepper flakes and bay leaves. Lower the flame and simmer for 15 minutes or until thickened. If it's too thick, add a splash more water or stock.
Meanwhile, to make the pesto, in a food processor, combine the basil, parsley, parmesan, pine nuts, lemon zest and juice, a big pinch of salt and pepper, and crushed red pepper flakes. Pulse a few times until evenly chopped through. Slowly drizzle in the olive oil while the machine is running and run until the pesto has thickened. Give it a taste and adjust seasoning accordingly.
Once the beans are done, remove from the heat, discard the bay leaves, and stir in the 1/3 cup parmesan until melted through. Serve with dollops of the pesto along with some crusty bread for dipping. Enjoy!