In the application of foams in the industrial field, there are often high requirements for foaming ability and stability, but this brings greater pressure for defoaming. This paper discusses the evolution kinetics of aqueous foams stabilized by the anionic surfactant sodium dodecyl sulfate (SDS) under the influence of MgCl 2 . It is found that MgCl 2 has a dual effect on the performance of SDS foam, which is shown by the enhanced foaming ability and significantly improved stability but rapid defoaming when drained to a certain film thickness. This phenomenon not only increases efficiency in industrial applications but also facilitates recycling and defoaming. To clarify the mechanism behind this interesting phenomenon, we discuss the influence of MgCl 2 on bubbles, adsorption, film strength, disjoining pressure, surface tension, and rheological properties. The results show that the addition of MgCl 2 can significantly reduce the surface tension and interfacial formation energy and increase the adsorption of surfactant, film strength, and bulk phase viscosity. The size of the generated foam becomes smaller and more uniform. These factors together led to the enhancement of the stability of foam with the thicker liquid film. However, the addition of MgCl 2 can also have some detrimental effects on stability. For example, faster adsorption kinetics and higher surface strength lead to a weakening of the membrane repair capacity. Most importantly, when the liquid film is very thin, the surface adsorbed by SDS has a strong specific adsorption for Mg 2+ , which causes interfacial adhesion directly, leading to the instability of the thin liquid film. This paper provides theoretical guidance on the use of magnesium salts as additives, offering new ideas for combining high foam application performance and low defoaming difficulty.