Pick through beans for stones or dirt. Cover beans with water and soak overnight. Drain and rinse well the following day.
In a large pot, cover the beans with cold water by at least 2 inches. Add herb sprigs and garlic cloves and bring to a boil over high heat.
Reduce heat to simmer and cook until beans are very tender, about 1 to 2 hours. Season with 2 teaspoons salt. Drain beans, reserving bean-cooking liquid. You should have about 3 cups of cooked beans. Discard herb sprigs.
Heat fat in a large skillet over medium-high heat. Add onions; cook until onions start to brown, 10 to 12 minutes.
Stir in serrano pepper and chipotle powder; cook 1 minute. Transfer drained beans into skillet. Mash about half the beans with a potato masher or back of a spoon. Ladle some bean cooking liquid to skillet. Continue to mash and stir beans as you gradually add more liquid.
Mash until the beans have reached your preferred consistency and texture. Taste and add more salt, if desired.
Notes
Refried beans are relatively new - culinarily speaking. They've only been served in northern mexico and TexMex recipes for about 100 years.
The term "refried beans" doesn't mean they were fried twice, but rather from the Spanish name for the dish—frijoles refritos. In Spanish "refritos" means "well fried".