The COVID-19 pandemic continues, and evidence on infection- and vaccine-induced immunity is key. We assessed COVID-19 immunity and the neutralizing antibody response to virus variants across age groups in the Swiss population. We conducted a cohort study in representative community-dwelling residents aged five years or older in southern Switzerland (total population 353,343), and we collected blood samples in July 2020 (in adults only, N = 646), November-December 2020 (N = 1457), and June-July 2021 (N = 885). We used a previously validated Luminex assay to measure antibodies targeting the spike (S) and the nucleocapsid (N) proteins of the virus and a high-throughput cell-free neutralization assay optimized for multiple spike protein variants. We calculated seroprevalence with a Bayesian logistic regression model accounting for the population's sociodemographic structure and the test performance, and we compared the neutralizing activity between vaccinated and convalescent participants across virus variants. The overall seroprevalence was 7.8% (95% CI: 5.4-10.4) by July 2020 and 20.2% (16.4-24.4) by December 2020. By July 2021, the overall seroprevalence increased substantially to 72.5% (69.1-76.4), with the highest estimates of 95.6% (92.8-97.8) among older adults, who developed up to 10.3 more antibodies via vaccination than after infection compared to 3.7 times more in adults. The neutralizing activity was significantly higher for vaccine-induced than infection-induced antibodies for all virus variants (all p values < 0.037). Vaccination chiefly contributed to the reduction in immunonaive individuals, particularly those in older age groups. Our findings on the greater neutralizing activity of vaccine-induced antibodies than infection-induced antibodies are greatly informative for future vaccination campaigns.