How Does Natural Selection Affect Genetic Variability?

Natural selection does both. As it favors certain alleles, it reduces variability by causing genes with those alleles to out-reproduce genes without them.

On the other hand, because selection acts independently at many loci, it can also increase heterozygosity and allele diversity, increasing species-level genetic variation. This allows populations to better adapt to shifting environments.