Soak beans: Rinse the beans and place them in a large bowl. Cover with water and leave to soak overnight.
Cook beans: Rinse again, place in a large bowl, cover with plenty of water, add the halved onion and the bay leaves and bring to a boil. Cook for about 1 hour or until the beans are soft. The cooking time will greatly depend on the size and age of the beans, so keep checking.
Drain the beans but keep the cooking water.
Combine: Discard the onion and the bay leaves. Leave the beans to cool slightly, then place them in the food processor together with about ¼ cup of the cooking liquid and two tablespoons vegetable oil. Next, add the grated garlic cloves (I prefer to grate the garlic myself before adding it to the food processor to make sure I will not bite on some larger pieces of garlic later).
Process until smooth, scraping down from the food processor walls a few times in between. Add more cooking liquid, a little at a time, to get the right consistency; it should be like a thick crème Fraiche or softer mashed potatoes.
Add salt to taste; I am generous with the salt here, but keep tasting until it is right for you.
Caramelized onions:
Slice onions: Halve the onions and slice the halves into thin half-rings.
Cook: Heat the oil in a large non-stick pan. Add the onions and ½ teaspoon salt and cook gently for 8 to 10 minutes, stirring from time to time.
Caramelize: When the onions are golden, add the tomato paste, sugar, and paprika powder and stir for 2 minutes, until well combined and slightly caramelized.
Transfer the beans to a bowl or a serving platter and top with the onions.
Serve: If served as a dip or bread spread, leave to get cold.If served as an accompaniment to sausages, meatballs, or any meat, do it straight away while still warm.Don't forget the pickles: cucumber, green tomatoes, red peppers, hot peppers, and so on.
Notes
About 600 g/ 1.3 lbs/ 3 ¼ cups cooked beans from a can, drained.