Grate the onion on the fine side of a box grater, or chop coarsely and grind to a purée in a food processor. Set aside.
Drain the beans in a colander and reserve about 1½ cups of the cooking liquid. Working in batches as necessary, process the beans to a smooth paste in a blender or food processor, using up to 1½ cups of the reserved cooking liquid to help the action of the blades.
In a heavy medium-sized skillet, heat the butter over medium heat. When it foams, add the onion and cook until just lightly golden, about 5 minutes. Add the beans, stir to mix thoroughly, and cook, stirring occasionally for 10 minutes, until the beans are thoroughly imbued with the butter flavor.
Taste for salt and add up to 1 teaspoon if desired (there will be some from the previous cooking of the beans).