To make the main spice blend: Finely grind the bay leaves, fennel seeds, and cumin seeds together and immediately mix with the cayenne.
To make the beans: Place the beans in a large container, add enough cold water to cover by 2 inches, and cover tightly. Refrigerate for at least 12 hours and up to 16 hours. Drain well, rinse, and drain again.
Heat a very large Dutch oven or other heavy pot over medium-high heat. Add enough olive oil to cover the bottom (4 to 5 tablespoons) and heat until very hot, shimmering, and almost smoking, about 2 minutes. Add the spinach and quickly spread it in an even layer. You want a really nice char on the spinach. Sear, using a wooden spoon to stir and smush the spinach and scraping the pot as needed. Keep cooking and adding more olive oil (up to 4 tablespoons more) if the spinach threatens to burn. The spinach is done when it’s a bunch of crisp green bits and the olive oil turns dark green, which should take about 10 minutes.
Add the onion, stir well, and season generously with salt and half the spice blend. Cook, stirring, for 2 minutes. Add the vinegar and stir well. Add the drained beans and the remaining spice blend. Stir well and add enough water to cover (3 to 4 cups).
Raise the heat to high, cover, and bring to a simmer. Reduce the heat to maintain a simmer and cook until the beans are tender, 40 to 60 minutes. Remove from the heat and season to taste with salt. Serve hot, warm, or at room temperature.
Make-ahead: The beans can be cooled completely in their cooking liquid and then refrigerated in their cooking liquid in an airtight container for up to 1 week or frozen for up to 2 months.