Perovskite solar cells have become the most important devices for solar power to electricity conversion. However, currently, high-efficiency perovskite solar cells still rely on the use of Pb, which is harmful to the environment. Seeking environmentally friendly perovskite solar cells is imperative, and Sn is the most effective substitute for Pb. However, Sn-based perovskites face challenges due to their brief lifespan and rapid degradation, underscoring the need to improve their phase stability - a problem with still unclear mechanisms. This study addresses this by adjusting the ratio of formamidinium to methylammonium (FA/MA) in FAxMA1-xSnI3, experimentally finding optimal stability in phase composition and photoluminescence intensity at a ratio where x = 0.75. Using Density Functional Theory (DFT) and a pre-trained, fine-tuned machine-learning model, we explore the favorable molecular structures and configurations within FAxMA1-xSnI3. We discover that the FA0.75MA0.25SnI3 composition exhibits the lowest valence band maximum, indicating minimal oxidation tendency. Further DFT calculations of mixing and formation energies confirm that this composition is the most stable, aligning well with experimental observations and elucidating the underlying mechanisms of phase stability in Sn-based perovskite solar cells.