The movement of genes between populations due to migration, which can either increase or decrease genetic diversity.