Want to learn more about natural selection? Just look for a black peppered moth—Biston betularia.

During the early 19th century in Britain, the moths used to have salt-and-pepper coloring. But over the years black versions of the moth began to prevail. These days, the dark variants are the most common, and geneticists have long speculated that the Industrial Revolution is to blame. Now, new research reveals the gene that made moths turn black and shows that the switch coincided with Britain turning to coal.

In a pair of papers published in the journal Nature, scientists uncover how and when moths became black. One paper shows that the same gene that controls the black color also dictates color and patterns in butterflies. A second tracks that genetic variation back to 1819, just as Britain began burning coal on a wide scale to fuel its new industrial machines.

If you think that coal caused moths to mutate, think again. Rather than cause the black color mutation, the sooty conditions of the Industrial Revolution created the perfect backdrop for black moths to survive. As soot covered surfaces throughout Britain, black moths blended in with their background, escaping notice by predators and thriving. The survivors passed on their genes and, through the wonders of natural selection, became more and more common.

Ilik Saccheri, an evolutionary biologist with the University of Liverpool who led the research on the second paper, tells Smithsonian.com that finding the responsible gene was complicated. “When a mutation is transmitted through time, it’s not transmitted on its own,” he says. He compares chromosomes to a bus that contains large numbers of passengers. Tiny mutations are passed along on a crowded “bus” that can make it hard to find the reason for a change in phenotype, or outward characteristics.

In this case, the team found that the mutation responsible for the moths’ color was not to be found in the predictable place. Instead of being tucked away in the coding or regulatory sequences of the moths’ genes, the mutation was hidden in its transposons. Also known as “jumping genes,” these DNA sequences copy and paste themselves throughout the genome and move, or jump, from one place in the genome to another.

Transposons used to be thought of as junk DNA and still aren’t fully understood. They’re only studied “by a few brave souls” today, says Saccheri, but they appear to have dramatically changed the appearance of the moths in this case.

Once Saccheri and his team figured out what they were looking for, they conducted a million simulations to track the mutation back to 1819—right when the Industrial Revolution started fueling sooty conditions in Britain. They estimate that the first mutation event likely took place at that time, but took about 30 years to become common enough to be noticed by observers. In 1848, a completely black version of the peppered moth was recorded in Manchester.

Though the discovery is important to geneticists, it’s also valuable because it’s so accessible. Peppered moths are so common that there’s probably one near your house right now—and thanks to transposon mutations and natural selection, the moths in your neighborhood could further change color as industrialization morphs their environment.

“We’re building evidence in support of that basic story,” says Saccheri. “You just can’t make this up.”