Some of those variants are better adapted to a particular set of environmental conditions than others. Here's a subtle point which is the key to understanding this subject. After all, there has to be a gene for each phenotype. There are two answers to that question. One is time.
Speed is the precious commodity of gene exchange.
If genes can be rapidly rearranged into new combinations, then changing environmental conditions can be met with new functions. But if diverse options cannot be rapidly brought together and remixed, then a large number of options must be sustained continuously, which is phenotypic variation. The other answer is that genotypic adaptation involves loss of genes. All of the disadvantageous genes are discarded. But gene exchange allows a complete variety of genes to be reacquired from their original sources of diversity.