I'm making the beef stock and after the stock has been brought to the boil, the recipe calls for skimming the foam. What is in the foam? Why it is bad and must be skimmed?
The foam is accumulated proteins—mostly albumen—that comes off of the meat and bones.
The main reason to remove it is that it is unsightly and unpleasant aesthetically. It isn't unsafe, just ugly.