Bacteria adhere and tend to form biofilms depending on signalling molecules released by them - many packed in membrane vesicles - which are dependent on pH and other conditions. Some of research papers from my lab describe membrane vesicle signalling models at my ResearchGate page .
I think that a biofilm medium needs docking points to build up a "phlegm". I have the suggestion that with the lowering of pH the docking points are occupied by protonation and the forming of a biofilm is repressed.