What is the butter for in a jam recipe?
The usual explanation given is that adding butter to the fruit and sugar before you cook it will reduce (or even eliminate) the foaming.

My guess is that the small amount of proteins in the fruits create the foam.  As you heat the fruit, the proteins open up into strands that get tangled up and help stabilize the bubbles into a foam. Adding the butter (a fat) helps prevent this tangling.