Don’t drain the beans!
Prep the fresh tomatoes, if using. Wash, and then add to a food processor and pulse until pureed. Or grate the tomatoes using the wide holes of a box grater.
Make the sofrito. Heat a large sauté pan over medium heat with 1 ½ tablespoons of oil. Once hot, add the onion with a pinch of salt and cook until the onion has softened and is golden but not browned, 5 to 6 minutes, stirring occasionally. Add the garlic, jalapeño, cumin, oregano, and chipotle flakes (if using) and cook for 1 to 2 minutes, stirring frequently.
Add the diced tomatoes. Adjust the heat as needed to maintain a rapid simmer and cook until the tomatoes break down and most of the liquid has evaporated, 8 to 10 minutes. Season with the kosher salt and several cracks of black pepper.
Pour the black beans with their liquid into the sofrito. Bring to a simmer and simmer for 15 minutes until thickened and saucy. If it gets too thick, add a splash of vegetable broth if you have it, or water.
Stir in a glug of extra virgin olive oil, a squeeze of lime juice, and cilantro. Taste, and add salt/pepper or more lime juice to taste.