Salt weathering is considered as one of the most damaging processes acting on cultural heritage sites and salt crystallization significantly contributes to the deterioration of natural sandstone in grotto relics. A laboratory partial immersion experiment was carried out to elucidate how humidity influences the salt‐induced weathering in grotto relics. Field environmental observations at the Yungang Grottoes were conducted to evaluate the differences between experimental endeavours and field observations. Superficial salt accumulation was characterized by hydro‐chemical and quantitative atomistic analysis. It revealed the co‐existence of calcium sulphate and magnesium sulphate, with a Ca/Mg molar ratio of 0.27 at RHam and 4.13–18.15 at a constant RH. An average increase of 165 mg/L in Na+ concentration and 120.7 mg/L in Mg2+ concentration in the groundwater was detected after immersion, which was attributed to the dissolution of the sandstone rock. The reduction of 322.5 mg/L in the SO42− concentration in the groundwater after partial immersion shows that capillary forces influence the migration of SO42− from the immersion solution. Calcium sulphate and magnesium sulphate accumulation with a Ca/Mg molar ratio of 0.03–0.17 in the field environment is strongly correlated with the occurrence of salt efflorescence. The upward transport of soluble salt was driven by capillary forces after partial immersion in the groundwater collected from the Yungang Grottoes. It then migrated from the interior to the exterior of the sandstone specimen due to evaporation. Salt efflorescence formed on the upper exposed stone close to the capillary fringe owing to the combined effects of condensation, hygroscopicity and evaporation. These processes were driven by wetting–drying and dissolution–crystallization cycles in response to fluctuating environmental conditions. These results contribute to a better understanding the mechanism of salt‐induced weathering and provide a basis for future conservation to mitigate the harmful impact of salts in heritage sites.