Wuliangsuhai Lake provides important breeding and stopover habitats for shorebirds. The health of this wetland ecosystem is rapidly deteriorating due to eutrophication and water pollution and environmental management is urgently needed. To explore the connections among ecosystem health, prey density, and shorebird populations, we conducted surveys of both the benthic macroinvertebrates and shorebirds in the shorebird habitat of the wetland during the 2011 autumn migration season. The abundance of both shorebirds and benthic macroinvertebrates varied significantly in both space and time. Our data showed a clear association between shorebird populations and the density of benthic macroinvertebrates, which explained 53.63% of the variation in shorebird abundance. The prey density was strongly affected by environmental factors, including water and sediment quality. Chironomidae were mainly found at sites with higher total phosphorus, but with lower sediment concentrations of Cu. Lymnaeidae were mainly found at sites with a higher pH, lower salinity, and lower concentrations of total phosphorus and Cu. Habitats with very high concentrations of total phosphorus, heavy metals, or salinity were not suitable for benthic macroinvertebrates. Our findings suggest that the reductions of nutrient and heavy metal loadings are crucial in maintaining the ecological function of Wuliangsuhai as a stopover habitat for migratory shorebirds.