1Heat lard or oil in a medium frying pan over medium heat until shimmering, about 2 minutes. Add onion, garlic, and salt and cook, stirring occasionally, until vegetables are soft and just beginning to brown, about 5 minutes.
2Add 1 cup of the beans and mash completely with the back of a spoon or a potato masher. Add another cup of the beans and mash completely, stirring occasionally. Add remaining 1 cup beans and mash, leaving about half of the beans intact.
3Continue cooking, stirring constantly, until the bean starches begin to coat the bottom of the pan and turn golden brown, about 3 minutes. Add water or bean-cooking liquid, bring to a simmer, and cook, stirring and scraping the bottom of the pan to incorporate the water and heat the beans through, about 2 minutes. (The beans may initially look soupy, but they’ll thicken as they cool, so be sure to add all of the water or bean-cooking liquid.)