Low plasticity limits the wide application of magnesium alloys. The influence of atoms (Gd, Y) on the generalized stacking fault energy (GSFE) is investigated by density functional theory (DFT), and the possibility of activating basal and nonbasal slip systems is quantified. The lattice parameters and elastic constants are also calculated via DFT. The tensile tests of Mg–2Gd, Mg–2Y, and Mg–2Gd–2Y (at%) are carried out to verify the calculated results. It is found that both Gd and Y atoms can improve plasticity, and Gd has a better effect than Y. The different degrees of influence are mainly due to the different electron types of atoms. Gd belongs to the s‐ and f‐electron type and Y belongs to the d‐electron type. The further calculation of the electron density difference indicates that Y weakens the influence of the Gd atom, and the mechanism diagram is constructed.