Genetic polymorphism varies among species and within genomes, and has important implications for the evolution and conservation of species. The determinants of this variation have been poorly understood, but population genomic data from a wide range of organisms now make it possible to delineate the underlying evolutionary processes, notably how variation in the effective population size (Ne) governs genetic diversity. Comparative population genomics is on its way to providing a solution to 'Lewontin's paradox' - the discrepancy between the many orders of magnitude of variation in population size and the much narrower distribution of diversity levels. It seems that linked selection plays an important part both in the overall genetic diversity of a species and in the variation in diversity within the genome. Genetic diversity also seems to be predictable from the life history of a species.