A mutated gene that improves reproductive success spreads widely – this is one of the principles of evolution. But sometimes other genes come along for the ride.
In the process of natural selection, specific genes spread throughout a population if they contribute to the reproductive success of a plant or animal. This is usually described as “survival of the fittest” – the fittest in this case is the adaptation that helps an organism thrive in a particular environment.
(Side note: this is one of my pet peeves about popular understanding of evolution. It’s not a one-way arrow from less to more advanced beings, a gradual and inevitable drive towards a state of perfection. “Fitness” in biology refers to the ability to thrive in a particular environment and is more or less bound to that environment. The polar bear is a pretty fierce animal, but drop it into the Sahara and it’s unlikely to do well. For that matter, a shark is an amazingly effective predator, but drop it into the Sahara and it’s probably not going to have a very good time either.)
(Side-side note: once I wrote that last side note I had no choice but to search for “sharks of the Sahara.” It turns out that they do thrive in the Sahara… well, in the Sahara Seamounts, an underwater mountain range off the coast of the Canary Islands. Close enough.)
Anyway, back to genetics. If a particular allele of a gene contributes to an animal or plant’s fitness then it’s more likely to survive into the next generation of that plant or animal. That’s how such genes spread through a population. There’s a wrinkle, though. Genes do not stand alone; they are “linked” with the genes that are near them on a chromosome. And when one gene is inherited by the next generation, genes that are near it are more likely to be carried over too.
What does this mean? A gene that improves reproductive fitness carries with it other (unrelated but linked) genes that do not directly improve fitness themselves. If that gene spreads throughout a plant or animal population then those mooching friendly genes come along for the ride. They are genetic hitchhikers.