Prepare Vegetables - Set Instant Pot to "Sauté" and then "Sauté More". When display says "HOT", add oil to pot. Stir in onions and sauté for 3 minutes. Add in ground cumin, oregano, and bay leaves. Sauté 1 minute, add garlic and stir for another 30 seconds.
Deglaze - Pour ½ cup chicken broth into pot and scrape up loose bits from bottom with a wooden spoon.
Cook Beans - If making refried beans with these cooked beans, add unpeeled onion and garlic head here. Otherwise, stir in beans, a pinch of salt, and remaining chicken broth. With venting knob in "Venting Position", close lid and set knob to "Sealing." Hit "Pressure Cook" then "High Pressure". Cook for 50 minutes then allow to "natural release" for 20 minutes. Carefully turn knob to "Manual Release" to release any remaining pressure. When pin drops, remove cover.
Serve or use for refried beans recipe - If unpeeled onions added for refried bean recipe, remove and discard. If not, add 3 pinches salt. If serving wet or, if using for refried beans, remove extra unpeeled onion and garlic head and proceed with refried beans recipe below. Beans can also be reserved without liquid to use in burritos and tacos.