The mechanism underlying species abundance distribution (SAD), particularly the characteristics of ''excess of rare species,'' remains controversial. The current equilibrium theory cannot explain the transient dynamics of SAD, which is essential for predicting biodiversity response to environmental changes. Using a unique 32-yr-long phytoplankton community data set from a pelagic site of Lake Biwa, Japan, we show that the dynamics of functional groups driven by environmental variation explain the excess of rare species over time. First, most of the rare species belong to the littoral group supplied through dispersal, whereas the common species belong to the pelagic group. Second, the littoral group was negatively influenced by environmental changes (i.e., lake warming, water-level manipulation, and partial re-oligotrophication), mechanistically explaining truncation of the excess of rare species in the SAD associated with biodiversity loss in Lake Biwa. Our findings imply the significance of an ecological trait-based approach for SAD theory and managing biodiversity in a changing environment.