The toughest animals in the world aren't bulky elephants, or cold-tolerant penguins, or even the famously durable cockroach. Instead, the champions of durability are endearing microscopic creatures called tardigrades, or water bears.

They live everywhere, from the tallest mountains to the deepest oceans, and from hot springs to Antarctic ice. They can even tolerate New York. They cope with these inhospitable environments by transforming into a nigh-indestructible state. Their adorable shuffling gaits cease. Their eight legs curl inwards. Their rotund bodies shrivel up, expelling almost all of their water and becoming a dried barrel called a “tun.” Their metabolism dwindles to near-nothingness—they are practically dead. And in skirting the edge of death, they become incredibly hard to kill.

In the tun state, tardigrades don't need food or water. They can shrug off temperatures close to absolute zero and as high as 151 degrees Celsius. They can withstand the intense pressures of the deep ocean, doses of radiation that would kill other animals, and baths of toxic solvents. And they are, to date, the only animals that have been exposed to the naked vacuum of space and lived to tell the tale—or, at least, lay viable eggs. (Their only weakness, as a researcher once told me, is “vulnerability to mechanical damage;” in other words, you can squish ‘em.)

Scientists have known for centuries about the tardigrades’ ability to dry themselves out. But a new study suggests that this ability might have contributed to their superlative endurance in a strange and roundabout way. It makes them uniquely suited to absorbing foreign genes from bacteria and other organisms—genes that now pepper their genomes to a degree unheard of for animals.

Thomas Boothby from the University of North Carolina at Chapel Hill made this discovery after sequencing the first ever tardigrade genome, to better understand how they have evolved. Of the 700 species, his team focused on Hypsibius dujardini, one of the few tardigrades that’s easy to grow and breed in a lab.

At first, Boothby thought his team had done a poor job of assembling the tardigrade’s genome. The resulting data was full of genes that seemed to belong to bacteria and other organisms, not animals. “All of us thought that these were contaminants,” he says. Perhaps microbes had snuck into the samples and their DNA was intermingled with the tardigrade’s own.

But the team soon realized that these sequences are bona fide parts of the tardigrade’s genome.

That wouldn't be unusual for bacteria, which can trade genes with each other as easily as humans might swap emails. But these “horizontal gene transfers” (HGT) are supposedly rare among animals. For the longest time, scientists believed that they didn't happen at all, and reported cases of HGT were met with extreme skepticism.

Recently, more and more examples have emerged. Ticks have antibiotic-making genes that came from bacteria. Aphids stole color genes from fungi. Wasps have turned virus genes into biological weapons. Mealybugs use genes from many different microbes to supplement their diets. A beetle kills coffee plants with a borrowed bacterial gene. Some fruit flies have entire bacterial genomes embedded in their own. And one group of genes, evocatively called Space Invaders, has repeatedly jumped between lizards, frogs, rodents, and more. But in all of these cases, it's usually one or two genes that have jumped across. At most, the immigrants make up 1 percent or so of their new native genome.

But Boothby found that foreign genes make up 17.5 percent of the tardigrade's genome—a full sixth. More than 90 percent of these come from bacteria, but others come from archaea (a distinct group of microbes), fungi, and even plants. “The number of them is pretty staggering,” he says.

Claims like these have been debunked before, so the team took extra care to confirm that the sequences did indeed come from outside sources.

For a start, they re-sequenced the genome using PacBio—a system that decodes single unbroken strands of DNA without first breaking them into smaller fragments. This revealed that the foreign genes are physically linked to the tardigrade’s native ones. They are all part of the same DNA strands, which means they couldn't have come from other contaminating microbes. They have also gained several features that are characteristic of animal genes, like an animal gloss over their fundamental bacterial character. John Logsdon from the University of Iowa, who studies genome evolution, is certainly convinced. “It’s a very interesting and technically robust paper,” he says.

So, how did these genes get into the tardigrade's genome in the first place? Boothby thinks that the answer lies in three quirks of tardigrade biology. First, they can dry themselves out, a process that naturally splits their DNA into small pieces. Second, they can stir back to life by rehydrating, during which their cells become leaky and able to take in molecules from the environment—including DNA. Finally, they are extremely good at repairing their DNA, sealing the damage that occurs when they dry out.

“So we think tardigrades are drying out, and their DNA is fragmenting along with the DNA of bacteria and organisms in the environment,” explains Boothby. “That gets into their cells when they rehydrate. And when they stitch their own genomes together, they may accidentally put in a bacterial gene.” By expelling their water, tardigrades have ironically become a sponge for foreign genes.

Do these genes do anything? So far, the team have found that the tardigrades switch on several of their borrowed genes, which, in other organisms, are involved in coping with stressful environments. That's pretty tantalizing: It suggests that these animals might owe at least part of their legendary durability to genetic donations from bacteria.

Boothby imagines something like this: Ancient tardigrades could dry themselves out to an extent, which allowed some foreign genes to enter their genome. If some of these genes made them more tolerant to drying, the animals would have become even more susceptible to horizontal gene transfers. “This positive feedback loop builds up over time,” says Boothby. “That’s speculation on our part.”

It certainly bolsters his case that another microscopic animal—a rotifer—can also dry itself out during tough times, and also shows signs of extensive horizontal gene transfer. Almost 10 percent of its genes came from foreign sources. Boothby’s team now wants to check for similar genetic infiltrations in other animals that tolerate desiccation, including some nematode worms, fish, and insects. They are also planning to gradually inactivate the tardigrade’s borrowed genes to see if that compromises its fabled invincibility.

Ralph Schill from the University of Stuttgart also points out that Hypsibius dujardini is something of a wuss among tardigrades, and isn't actually very good at surviving desiccation. Perhaps the genomes of its hardier relatives—the ones that shrug off extreme cold, extreme heat, and open vacuums—will yield even bigger surprises.