Serious foaming problems and the excessive consumption of defoamer have undoubtedly become one of the most critical problems that hinder municipal solid waste (MSW) leachate treatment efficiency and industry development. Since there is limited research penetrating the foaming mechanism and identification of the key surfactants, current defoaming and surfactant removal techniques lack pertinence and orientation. In this study, a foaming characterization device was developed and ultra-performance liquid chromatography-tandem mass spectrometry (UPLC/MS/MS) was optimized to accurately identify the key surfactants affecting leachate foaming and offer a glimpse into their interaction mechanisms. This study collected leachate samples from 9 typical landfills and waste-to-energy facilities of various waste compositions, climatic conditions, ages, and geographical locations. The foaming problem of leachate was mainly centered on raw leachate and nanofiltration membrane concentrate (NFC). Fresh leachate performed with relatively low foaming capacity and foam stability, associated with low surfactant concentration. The pH value of the system was positively correlated with the concentration of anionic surfactants, indicating significant impacts on surfactant release in MSW. Since the distribution characteristics of linear alkylbenzene sulfonate (LAS) in leachate were consistent with the variety of foaming performances, LAS proved to be an indispensable surfactant in the leachate involved in this study, and its content proportion escalated to 92.87% in aged leachate.