Gene flow, or the transfer of genes from one population to another, occurs whenever an individual (or group) moves and encounters another individual and genes are exchanged.
Gene flow happens when an immature animal leaves its natal group and joins a new group either permanently or for an extended period of time. Gene flow can also happen during migrations, if animals come into contact with new animals and genes are exchanged.
In the image below, we can see that the addition of a brown beetle to the population in the white circle will add another instance of this gene and increase its frequency within this population. If the beetle was black, this individual may introduce an entirely new gene to the population. Either way, this is an example of gene flow.