The short answer is chemistry! If there is a high level of calcium within the water the beans are cooking in, they may take an extremely long time to cook and may remain hard. There are pectins between cells in the beans, which then combine with the calcium, resulting in a tightened bond which means firmer beans. Acidic ingredients typically added to the recipe, such as ketchup and vinegar, can also impede the process of the beans getting soft. Sugar can act in the same manner as calcium, so molasses is very tricky to cook with because it contains sugar, is acidic, and contains calcium. Yikes! So the trick is soaking the beans before cooking. Beans should be covered in three times as much water as there are beans. You can slowly soak or quickly soak them on the stove. Either way, the soaking water should be drained off the beans before beginning the Baked Beans recipe.