Biological foam has seriously troubled the wastewater treatment process and brings major challenges to effluent quality, process efficiency, and operation safety. This study systematically analyzed bio-foam characteristics from three piggery wastewater treatment stations to reveal potential foaming mechanisms. The low surface tension for piggery wastewater led to strong foaming capacity, and high viscosity and Zeta potential contributed to foam stability. The long-chain fatty acids (LCFAs) in wastewater were proved to be the key components responsible for foaming: the decrease of surface tension caused by LCFAs directly induced strong foaming ability (physicochemical path); moreover, LCFAs favored the enrichment of non-filamentous foam-related microbes like Hydrogenophaga and Pseudomonas to secrete extracellular polymeric substances, increasing the viscosity and Zeta potential to maintain foam stability (biological paths). Based on the revealed foaming mechanism dominated by LCFAS, this study provided novel insight and valuable guidance for the efficient and safe treatment of piggery wastewater.