This paper has explored the effects of different gases on the foam-coarsening behavior and drainage process of APG, and combined with molecular simulation to analyze the molecular behavior and interaction between molecules of APG in different gas phases. The influence mechanism of different gases on APG was analyzed by radial distribution function (RDF), mean square displacement (MSD), interaction energy (IFE) and other results. The results show that due to the interaction between gas, water and APG, the hydrophilicity and molecular behavior of APG are affected, resulting in differences in coarsening behavior and drainage process of foam. CO 2 has a significant impact on the stability of APG foam. When N 2 is used as the foaming gas, APG foam has the most stable foam performance. This work provides relevant information about the factors affecting the foam stability and contributes to a better understanding of the foam stability mechanism.