Radon concentration in groundwater is affected by meteorological and seismo-tectonic factors and is sensitive indicators of crustal stress. While previous studies have focused on the mechanisms of periodic and precursory radon anomalies, few have quantitatively assessed their influences, and compared their rates of change under normal and earthquake conditions. This study constructs four models to analyze the mechanisms of radon variation under natural and seismic conditions using the Extreme Gradient Boosting method: 1) the multi-year dynamic variation model, 2) the maximal radon concentration model, 3) the minimum radon concentration model, and 4) the precursory anomaly model. The feature relative importance of external factors influencing radon concentration in groundwater are estimated. The optimized extreme gradient boosting model estimated the feature importance of spring discharge (SD), water temperature (WT), precipitation (P), barometric pressure (BP), and antecedent radon (AR) to be 23.79%, 22.16%, 9.81%, 18.8% and 25.44%, respectively. Thus, SD is the most important influence on radon variation under normal conditions. For radon variation during the earthquake preparation period, the feature relative importance indicates significant changes in WT (increasing from 22.16% to 27.70%) and SD (decreasing from 23.79% to 17.99%). Although WT was the most important predictor in the precursory anomaly model, its effect on radon solubility is insufficient to explain the radon anomalies prior to the Lijiang Mw 7.0 earthquake. Analysis of the precursory mechanisms of these radon anomalies in terms of SD, WT, P, BP, and radon emanation found that radon anomalies are most likely caused by increases in radon emanation due to the earthquake-induced formation of microfractures in rock.