Every morning I cook a pot of beans. Every morning it foams up and boils over unless I catch it and turn the heat way down and stir, stir, stir. It only happens right in the beginning. After that I can turn it up and it doesn't foam.
Here are this morning's red lentils. Red lentils notoriously foam.