The electric eel is one of the many creatures Charles Darwin sliced up and examined in his years aboard the H.M.S. Beagle. When he cut it open, he found that 80 percent of the fish’s body was taken up by three organs made of what looked like muscle tissue, but not quite. This is where the animal makes electricity.

After finding similar organs in other fish, Darwin correctly deduced that the lineages—six in all—came to the same adaptive conclusion independent of one another. Until now, though, no one has known how similar they were. According to a paper published today in Science, at least three of the six lineages evolved their electric organs through the same genetic pathways.

Taxonomically, these lineages were too distantly related to have inherited the organ from a common ancestor. In Origin of Species Darwin wrote that “Natural selection, working for the good of each being and taking advantage of analogous variations, has sometimes modified in very nearly the same manner two parts in two organic beings.” Biologists call this convergent evolution.

“Imagine houses in built different parts of the country. The house in New Mexico may look different from a house in New England, but they’re built using the same basic structural parts,” said co-author Jason Gallant, a biologist at Michigan State University.

The team started with the electric eel—not actually an eel, but a type of knifefish. They took took DNA samples from cells in its electric organ—called electrocytes—and compared it to the DNA from other tissue, including its muscle, kidney, and nerve cells. From about 25,000 genes, about 100 stood out. In muscle cells, which electrocytes evolved from, these genes control the ability to contract. In the eel, these genes were highly suppressed. “We think these are the ones that turn off the ‘muscleness’ of a muscle cell and turn on the current-generating ability,” said co-author Michael Sussman, a geneticist from the University of Wisconsin-Madison.

The electric organ discharge starts when the fish’s brain sends signals that release a neurotransmitter onto the electrocytes. This opens tiny molecular doors that allow positively-charged sodium ions to rush in, creating an electric current. Our brain cells operate by moving ions around in a similar way.

After they’d isolated the genes in electric eels, the researchers looked at the RNA—the acid that encodes genes from DNA—of two other lineages of electric fishes. They found that the same genes were similarly manipulated, all with the same effect: Tweaking the muscle cell genetic code as a blueprint for a little organic battery.

Each electrocyte only turns out about 50 millivolts of electricity, but they are stacked end-to-end in the organ, so their charges accumulate like batteries in a Maglite. The eel’s electric organs (which take up about four-fifths of its body) can generate up to 600 volts. “There’s enough power in the eel’s electric organ to kill anything it wants,” said Sussman.

In each of the six electric fish lineages, there are several to hundreds of species. In Africa, there are over 200 species of electric elephantfish, and Gallant says that number has grown a lot in relatively recent evolutionary history. This is because they use their electric charge to communicate, in addition to helping them navigate the roots and rocks in their murky, river habitats. (Using electricity for predation, like the electric eel does, is a rarity among electric fish species.)

Each species of African elephantfish has its own specific frequency or pattern, a niche that helps it distinguish its own kind from the crowded, muddy water.

“What’s really interesting is that this diversity of electric discharges—really, the invention of new electric discharges—might be driving new species,” said Gallant.

The recording below is the amplified sound of the electrical frequency that the Brienomyrus brachyistus elephantfish uses during courtship.

Sussman believes this research might have practical applications. Someday, he says, scientists might be able to create electrocytes from human stem cells, which could power biomedical devices like pacemakers or insulin pumps. But this, he says, is probably years away.

“I’m not promising people that you’ll have electric organs and be able to charge your cell phones right away,” he said, “but I’m hoping that this paper might inspire research that will be able to create electrocytes.”

However, the air we live in doesn’t conduct electricity like water does, so you probably don’t have to worry about getting shocked by a bio-engineered super villain.