The relationship between wetland water level changes and plant community has been a research hotspot. However, the gradient changes and critical influencing factors of plateau lakeshore plants and soils during wet-dry alternation remain unclear. Here, we studied the variations in plants and soils along the Erhai lakeshore across three elevation ranges (1965.0-1965.3m, 1965.3-1965.6m, and 1965.6-1966.4m) during flooding and drought years. Our research aimed to elucidate the interrelationships and mechanisms among hydrology, soil properties, and plant dynamics. The results showed that (1) In drought years, the Shannon-Wiener index of plants significantly decreased across the three elevation ranges, and other plant diversity indices, biomass, and coverage also decreased to varying degrees; (2) except for soil pH, soil water (SW) and nutrient content decreased to varying degrees in the drought year; (3) SW was the primary factor influencing plant biomass, coverage, and diversity in the 1965.0-1965.3m and 1965.3-1965.6m ranges; nitrate nitrogen, C/N ratio, total phosphorus were the primary factors in the 1965.6-1966.4m ranges. The results of structural equation modeling revealed a significant and strong correlation between SW and plant biomass, coverage, and soil pH. This suggests that changes in SW directly impacted plant biomass accumulation, subsequently affecting coverage, and also played a role in regulating soil pH. This study identified the effects of hydrological inter-annual changes on plant communities and highlighted SW as a crucial driver. The strategies proposed in the results protect and improve the diversity and stability of lake ecosystems in Lake Erhai and other similar lakes.