Cover the beans, the halved onion, and the halved pepper with water in a pot and refrigerate overnight.
The next day, simmer with the bay leaves until tender, up to an hour. Stir in salt.
Make the sofrito:
Sauté the diced onion, diced green pepper, jalapeños, and garlic in olive oil until soft. Stir this mixture into the beans.
Remove the bay leaves.
Take the mushy onion and green pepper along with 2 cups of beans and process them in a blender until smooth.
Add this back into the pot along with the beef stock.
Stir in oregano, cumin, sugar, and red wine vinegar.
Simmer at least another 30 minutes, though the dish can go longer.
Serve with white rice, sour cream, and a sprinkle of fresh cilantro.