Once a newly hatched spittlebug is hatched it will wander until it finds a suitable host plant with a succulent supply of sap. The beak is inserted down to the xylem and they begin to suck considerable quantities of sap. The excess water and sugar is forced through the gut and out the anus where it adheres to the plant and nymph which moves the liquid over its body using the back legs. The nymph breathes through spiracles on the outside of the abdomen. Bubble making happens by vigorous movements of the abdomen as the nymph sucks air into its abdominal breathing tube and forcing it out, while pumping its abdomen and moving it every which way. There is a mucilaginous substance that is exuded from glands on the abdomen that keeps the bubbles from collapsing…and why the goober balls feel so slimy when you get them on your legs as you are walking. This foam keeps away predators, keeps the wee nymph moist and insulated.
http://www.sciencedirect.com/science/article/pii/0020179087900096 (the froth composition...should you care to know)
The species that we found (pretty sure....I'd like to find an adult to be 100%) on Leaning Oaks is Philaenus spumarius - and *sigh*, it is a European introduction. There are other possibilities here for other species so we will keep looking. It can be a economic pest on some crops if in high densities or when the froth acts as a vector for fungi. So far our rosemary is doing just fine--
Oh--and if you want to identify your spittlebugs, Agriculture Canada has a book for you! On line courtesy of the Entomological Society of Canada: