Foaming ponds are normally a sign that you have free proteins knocking about, as Margaret says. This can come from algae (including unicellular algae that you can't really see with the naked eye), or from animal sources (if your filter is pureeing the daphnia or cyclopes, for example), and is unsightly, but no real problem. Unless you are getting surface water contamination (rainwater runoff from roads etc.) it's unlikely to be detergent foam, but if you are taking water from a surface source, it's just possible that that's the cause. If it is, and ONLY if it is, a water change is worth considering. The commonest cause of algal proliferating, be it bloom or blanket weed, is an elevated nitrogen level. Short of installing a straw bale filter, there's not much you can do about it, except removing excess blanket weed. Unfortunately, doing that means splatting too many invertebrates for it to be attractive in my eyes.