In a medium saucepan set to medium heat, warm the olive oil until it shimmers. Add the onions and salt. Cook, stirring occasionally, for about 5-8 minutes until the onions have softened and are turning translucent.
Add the garlic, chili powder and cumin. Cook, stirring constantly for about 30 seconds until fragrant. Add the drained beans and the water. Stir, cover and cook for 5 minutes.
Reduce the heat to low and remove the lid. Use a potato masher or the back of a fork to mash at least half of the beans until they reach the desired consistency. Continue to cook the beans, uncovered, and stirring often for about 3 minutes.
Remove the saucepan from the heat and stir in the cilantro and lime juice. Taste, and add more salt and lime juice if needed. If the beans are dry, add a very small amount of water and stir to combine. Cover until ready to serve.