The study of how genetic variation is distributed within and among populations of organisms, and how it changes over time.