Long-term ecological studies are powerful tools to investigate microbiomes and ecosystem change but have mostly ignored viruses. Here, we leveraged a 20-year time-series of a freshwater lake to characterize 1.3 million viral genomes over time, seasonality, and environmental factors. We identified 578 auxiliary metabolic gene (AMG) clusters representing over 150,000 AMGs, the most abundant of which, including psbA for photosynthesis, pmoC for methane oxidation, and katG for hydrogen peroxide decomposition, were consistently represented in viruses across decades and seasons. We observed positive associations and niche differentiation between virus-host pairs during seasonal change including in keystone taxa, Cyanobacteria, methanotrophs, and Nanopelagicales. Environmental constraints, specifically inorganic carbon and ammonium influenced viral abundances over time, and highlighted roles of viruses in both “top-down” and “bottom-up” interactions. Key evolutionary processes shaping gene and genome-wide selection included favored fitness genes, reduced genomic heterogeneity, and dominant sub-populations carrying specific genes. Overall, our study advances understanding of diversity, ecological dynamics, and evolutionary trajectories of viruses in Earth’s microbiomes and ecosystems.