Run cooked beans through a food mill (for very smooth consistency) or mash them with an immersion blender (for chunky beans).
In a large frying pan, fry bacon bits until crisp. Take out of the pan.
In the same pan, saute the onions until they are soft and translucent. Add garlic, bacon and beans and cook on low heat for about 10 minutes. If the mixture is too dry, add a little bit of milk or water.