For refried beans, the best tasting ones are the ones made old fashioned. If you don't know, old fashion in mexico usually means lard. You want old fashioned tamales, you put lard in them. Old fahsioned tostadas are fried in lard. Old fashion cars run on lard.
And old fashion beans are refried in lard or bacon fat.
Refrying does not mean to fry twice. It rather means to boil your beans, then mash and fry. The translation is more like "well-fried beans".
Buy dry pinto or peruano beans.
For every cup of beans, add four cups of water. Use a tall, large pot. Wash your beans, and quickly check for stones or twigs. Then mix the beans and water in the pot. Start by hot soaking them under medium heat for half an hour. Then start simmering them in medium high heat. Let them boil for an hour or two. If they need more water, just add more. Never let them dry. Stir every now and then. Add half of a chopped onion, a green chile, just sliced up, and one galic clove. Let it simmer. Test one or two beans every now and then. Once they get close to being done, reduce the simmer to medium heat. Once they are practically done, add the salt. If you add the salt anytime before, your beans will never soften. Congratulations dumbass, you just wasted half a day.
Once your beans are soft, salted, they can be eaten like they are. Frijoles de la olla (beans from the pot) are the building block for many meals. A lot of families have this as a main dish, so be grateful you can afford to buy meat. But anyway, you wanted refried beans.
Drain a good amount of cooked beans and put in a deep frying pan. Pour some oil or lard. Not too much, just like a couple of table spoons for about four cups of cooked beans. Throw a bit of bean broth in there too. Heat it up on medium heat. Then start mashing with a potato masher. I like mine half mashed, half whole beans. More texture that way. You can mash yours to putty if you prefer. Once they are mashed, they are VERY prone to sticking to the bottom and burning, so stir them constantly. Once the beans become "milky" in appearance, shut the heat and let sit. This milkiness is a sort of sheen caused by the starches sort of caramelizing or something. Once the beans cool down a bit, they will become thicker. you can now eat them.
You can make refired beans fancier by mixing cooked bacon chunks, fried onions, cooked chorizo crumbs. One recipe for a famous restaurant in Guadalajara involves mixing some roasted tomato sauce and some cooked corn kernels. Delicious.