Pick over the beans for imperfections or foreign matter. Soak them in water overnight. Discard any “floaters” and drain.
Heat the oven to 350°F.
Heat a large Dutch oven or other heavy-based 5-qt. pot over medium heat. Add the diced salt pork and cook until crisp and golden, letting most of the fat render, about 10 minutes. Add the onion and garlic (if using) and cook until it begins to soften, about 5 minutes.
Add 4 cups of the water, the molasses, maple syrup, chili sauce or ketchup, mustard, Worcestershire sauce, and pepper. Stir well to combine. Increase the heat to high and bring to a boil. Add the drained beans and the reserved pork rind and wait for the boil to return. Cover the pot and transfer it to the oven.
After the beans have been in the oven for 10 minutes, turn the heat down to 300°F. After 1 hour, check the pot and add water as needed to keep the beans just barely covered. Check it again every hour. You may need to add up to 1 cup for navy beans and 1-1/2 cups water for yellow-eye beans, but be wary of making them too watery, especially near the end of cooking.
The beans are ready when they’re very soft and tender yet still retain their shape, about 2 to 2-1/2 hours for navy beans; 3-1/2 hours for yellow-eye beans. Remove the beans from the oven and discard the pork rind. Add the vinegar and season the beans with salt and more pepper, if you like. Stir the beans gently; as you stir, the starches will be released and the baked beans will become lightly thickened. Don’t overmix when they’re this hot. Let them sit for at least 20 minutes before serving. They can also be cooled completely, refrigerated, and then gently reheated.