Lard is the fat of choice in many "el cheapo" canned refried beans, and could be what you are missing.
cooking.stackexchange.com/users/35357/Debbie M.
My first guess would be: more salt than you think.
This is probably the main "secret" for most processed foods.
Ortega Traditional Refried Beans have 560 mg of sodium per serving (that's a serving of 131 g, making 3.5 servings in a standard can).
A 1/4 tsp of table salt has 590 mg.
If you're making the equivalent of 1 can of beans, you would have to put in a little over 3/4 tsp of salt.
If you're making a biggish pot, starting with 1 kg of dry beans (makes about 2 kg cooked), that would be about 4 tsp (9.5 g) of salt.
Yeah, it's a lot.
You can think about whether you really want to do that.
Other suggestions I have heard: sugar and cinnamon. Haven't tried it myself, though.
cooking.stackexchange.com/users/27125/Nate Eldredge
You're missing fat in the equation.
The previous member suggests bacon
but I don't know how you feel about the smoke flavor but fat will do you good.
cooking.stackexchange.com/users/43026/Water_Mizu
Try mashing the beans with butter and bacon drippings along with just a enough cumin so you can "tell" it's different but you can't taste the cumin.
cooking.stackexchange.com/users/33134/Escoce
You might be missing epazote .
IMHO an absolute must in any Mexican bean dishes.
Do not overdo it though.
cooking.stackexchange.com/users/26103/user58697
Lard.
It's all you need.
There is usually a tub of it in the same part of the store as Crisco (vegetable shortening).
cooking.stackexchange.com/users/43101/mmaceachran
I see plenty of advice out there on how to make canned pinto beans taste delicious, but does anyone know how to recreate that  cheapo refrito  taste? I've tried countless combinations of freshly cooked pinto beans, salt, garlic, chili powder, onions...  They always seem to be missing some crucial element, and I don't mean the sitting-in-a-can-forever-flavor!
How to make homemade pinto beans taste like canned refried beans?
cooking.stackexchange.com
<spices><beans>
cooking.stackexchange.com/questions/66153
cooking.stackexchange.com/users/43091/anon
Cheap canned refried beans often use lard, so you could mash the beans with this or with butter and bacon drippings. You may not be adding enough salt, or the missing flavour could be cumin, epazote, sugar or cinnamon. There a number of ingredients that could be mssing when attempting to recreate "el cheapo" beans. These include fat, sugar, salt and epazote.
Fat is probably missing from the "el cheapo" recipe. Salt could be a missing ingredient. Sugar or salt may be added to get the desired taste. Epazote may be the missing ingredient.