There are a bunch of factors that affect the amount of foaming, loosely they can be divided in to nucleating points and protein content of the wort.
Nucleation points are any sharp points where bubbles in a critical fluid start to form an example being those fine scratches in the bottom of some beer glasses, or possibly in your case more bits of malt and husk in the wort. this just provides more bubbles rising to the surface, it isn't really related to a persistent foam, but will exacerbate any existing foam problems.
You don't say what was in the mash but some ingredients cause more foaming than others, we add wheat to improve the foam on a lot of beers, if your brew contained more wheat or flaked product than usual that to can produce more foaming.
The main cause of foam at the start of a boil is protein, particularly very large molecular weight protein, there are hundreds of millions of different proteins (something like 1X1026 from memory) anyway far too many to give them all names, so we just group them by size, the largest soluble proteins in the wort are over 100,000mw in weight, these condense (break) fastest, the next group down 50,000-100,000mw protein next fastest and so on, at the end of a couple of hours of boiling all the 100Kmh+ protein will have condensed and formed Hot Break (its called hot break after it has coagulated and become insoluble (broken)). At the same time 95% of the 50-100Kmw will have broken and only about 1/2 of the <5,000mw proteins that we want to keep in the wort to build head retention in the finished beer.
Most of the really large proteins actually break at mashing temperatures and become trapped in the grist, BIABers who squese too enthusiastically can be adding a lot of very high weight protein to the wort, and cause a lot more foaming and end up with a lot more trub in the kettle.
Without knowing a hell of a lot more about your brew than I do it's very hard to give a simple answer as to the cause, but from what is above you can probably see that its a combination of factors.
The amount of protein, the size of the protein, the amount of energy going into the boil and the number of nucleating points all working together.
The amount of soluble protein mostly being decided by your choice of ingredients and whether or not you are doing a protein rest (makes more soluble protein), bag squeezing...
Getting enough energy into the wort (boil vigour) will help determine how long the protein that is in solution takes to break.
The number of nucleating points, that's one of the reasons brewers talk about running bright wort (clear) to the kettle.
You will get better beer if you try to get as clean a wort as possible before the start of the boil. Wait until you have achieved a good break before you start the clock and making your hop additions. Don't skim the wort, there are a very finite amount of head building ingredients in a wort and if you skim you will reduce these in the finished beer.
Isn't brewing fun
Mark