Set Instant Pot to sauté. Add oil. When the Instant Pot is hot, add the onions and sauté for 4-5 minutes until translucent.
Add the garlic and sauté for 1 minute.
Add the cumin, chili powder, oregano, salt, pepper and cayenne pepper (optional). Stir to combine and coat the onions and garlic with the spices.
Add some of the broth and scrape anything stuck to the bottom of the pot. Add remaining broth, water, beans. Stir until well combined. Turn off Instant Pot (on some models you do this by pushing Cancel).
Put the lid on the Instant Pot and lock. Set it to the sealing position. In manual or high pressure mode, set for 40 minutes. The Instant Pot will take about 15 minutes to pressurize before the 40 minutes begin.
Once done, allow the pressure to naturally release for 20 minutes. Then carefully release any additional steam by turning the release valve to the release position. Remove the lid.
Drain the beans, reserving the cooking liquid.
For vegetarian beans, return the beans to the pot. Add ½ cup of the cooking liquid and use a potato masher to mash the beans until they’re the consistency you want. If you want, you can use an immersion blender for pureéd beans. Add additional cooking liquid for thinner beans. Beans will thicken up after sitting.
For traditional beans, turn Instant Pot to sauté setting. Add 2 tablespoons of lard or oil. When hot, return beans to pot. Sauté beans for a couple minutes. Stir in ½ cup of cooking liquid. Mash the beans with a potato masher or pureé with an immersion blender. Add more liquid, if desired. Beans will thicken after sitting.
Serve. Top with crumbled queso blanco (white Mexican cheese) and cilantro. Or add sliced jalapeños, diced tomato and avocado.