Add oil to a large skillet, preferably nonstick; place over medium heat.
When the oil is hot, add in the onion and cook/stir until it is golden brown, about 10 minutes.
Add in the cumin and cook/stir, 1 minute.
Add in the beans and mash with a large fork or potato masher; continue to cook and mash, stirring, until the beans are more or less broken up (some remaining chunks are fine).
Season with salt and pepper; add the cayenne and more cumin if you like, and serve.