“To the sea, to the sea! The white gulls are crying, The wind is blowing, and the white foam is flying. ~ J. R. R. Tolkien
To the cellar, the cellar. The winemaker is crying. The aerators are blowing and the white wine foam is flying. ~ A.L.O. Usypoet
Wine foams when aerated. This can be easily seen when next time quaffing a Chateau Gondwana with a straw. Try blowing through the straw instead of sucking and the results will astound (and make a nice mess!)
The reason any water will foam when aerated is usually because of something in the water that reduces the surface tension between the water molecules. Alcohol and tannins are just such agents. Their chemical properties are such that they weaken the hydrogen-oxygen water bonds.
When a winery waste-water treatment plant foams, this is mostly a sign that a fair amount of wine has been dumped. Although the biomass in the bioreactor does a good job containing the foam, it has a tipping point. For this reason, it always makes sense to fit a cover over an aerated winery effluent treatment plant. (See HWT bioreactors)