The world has been plagued by complex waves of SARS-CoV-2 epidemics that vary from region to region, leaving the end of the pandemic unpredictable. Here we performed "genetic fingerprinting" to compare the local viral genotypes with epidemiological information and reveal the molecular dynamics of the SARS-CoV-2 epidemic worldwide. A multifaceted analyses of the epidemic trends and their relationship to virus genotypes, regional herd immunity, population density, and race has shown that epidemic outcomes are affected by: (1) Increased fitness of the virus due to mutations of viral proteins; (2) Immunity against previously prevalent subtypes that prevents or exacerbates COVID-19; (3) Immune evasion due to viral mutations; (4) Viral competition with coexisting subtypes; (5) Dense and crowded living environment; (6) Racial and social disparities; (7) Upper limit of viral mutations that enable natural selection. These findings provide an overview of the current epidemic, help predict the future, and develop effective countermeasures.