Kelsey Coolahan’s obsession began during her third year at Cooper Medical School, part of Rowan University in New Jersey.

“I’m in the labor and delivery room, and I’m witnessing this whole miracle-of-birth thing, it’s amazing,” Coolahan remembered. “And then you have one lonely resident at the foot of the bed who is slowly pulling something out of mom’s uterus … he pulls it out, does a quick inspection, then slaps it on the table and turn back towards mom. But I didn’t turn my back. What is this thing?”

That thing was the placenta.

“It’s like an alien meat cake. A purple alien meat cake. It looks like it should be pulsating because it looks like it landed here from another planet,” Coolahan said.

If you picture a baby in the womb, it’s sitting in a thin sac filled with amniotic fluid. The sac is made by the baby — one part of it thickens and basically attaches to the womb. That thicker part is the placenta.

For whatever reason, the placenta whose delivery Coolahan observed needed some further inspection in the pathology lab. Most people would have followed the baby, but she decided to follow the placenta. That’s where she met Julieta Barroeta, who specializes in gynecological pathology at Cooper University Hospital.

“That’s where I started to realize the placenta was even more interesting than it looked,” Coolahan said. “First, it’s the only temporary organ. Second, it’s the baby’s lung, it’s a waste-disposal system, and it’s a nutrition source.”

For the placenta to do all that amazing stuff, it has to do something no other tissue can do.

“The placenta is essentially a fascinating organ because it allows for two human beings that are genetically very different. Because half of the fetus is maternal, but the other half is paternal, and yet the pregnancy can go on for nine months without the mom’s body destroying it,” Barroeta said. “And that, from an immune standpoint, is fascinating, because if you were to receive a piece of someone else and insert that under your skin, that would not last there for three days, your body will actively reject it.”

So the placenta has to be the most incredible gatekeeper. It has to let oxygen and nutrients get to the baby, and it has to let carbon dioxide and waste get out. For example, medicines can get through, protective antibodies can get through. But if the mother and baby ever actually touched, or if any blood got through, the mother’s immune system would immediately kill the baby.

Coolahan kept researching. She stumbled across a paper by Ed Chuong, who researches molecular cellular developmental biology at Biofrontiers Institute in Colorado. According to Chuong, “The placenta we think of as a defining characteristic of live-bearing mammals … primates, rodents, dogs, cats, etc.,” is estimated to have evolved about 150 million to 200 million years ago. Before that, if you wanted to reproduce, you had to lay eggs.

So before placentas, a baby had to be in an eggshell. Literally walled off. “All the nutrients baby needed had to already be in the egg from the get-go,” said Coolahan. “If you think about a chicken egg — that’s exactly what the yolk is, it’s a care package that has to last the embryo till it’s born.”

Chuong added, “the evolution of placenta essentially involved losing that eggshell and instead replacing that with some sort of tissue or organ that attaches to the mother’s uterus during development.”

But losing that shell presents some challenges. “It’s important that the maternal and fetal blood streams remain separate,” Chuong said. “And so the separation of these bloodstreams is established through this cell layer called the syncytiotrophoblast.”

The syncytiotrophoblast is the outermost layer of the placenta, the part that is pressed against the uterus. It’s literally a layer of cells that have fused together, forming a wall.

“This is where the magic happens,” Coolahan said. “This wall of cells keeps mom and baby working in harmony and not killing each other. There’s no other structure like this anywhere else in the body.”

When evolutionary biologists like Chuong mapped the genomes of these cells, they found that the protein that allowed these cells to fuse into a wall, called syncytin, didn’t look like it came from human DNA. It looked more like HIV. According to Chuong, this protein actually came from an ancient retrovirus, the most famous of which is HIV.

Viruses are little strips of biologic information that can’t do anything on their own. So they enter cells and hijack the cell’s machinery to make copies of themselves and replicate and move on to infect other cells. Retroviruses take it to the next level because they are strips of DNA that enter cells and just go ahead and insert themselves into the host’s own DNA. Now, the host is stuck with viral DNA for the rest of its life, and it can never stop doing what the virus wants.

Viruses such as HIV have been infecting vertebrates for probably a couple hundred million years, according to Chuong. So, according to evolutionary biologists, once upon a time some retrovirus infected an egg-laying vertebrate. And by chance, that virus settled into that animal’s egg cells. And it just so happened that that particular infected egg met a nice sperm and got fertilized. The baby that was hatched — whatever kind of protomammal it was — now had copies of that virus’ DNA in all its cells.

This virus didn’t kill the baby — if it had, we wouldn’t be sitting here as humans telling this story. What it did was give this offspring a premium feature.

“We got an upgrade,” Coolahan said. “Viruses fuse with things in order to infect them. Now, we get this viral DNA that lets us make a protein that fuses things.”

Once a viral protein, the virus essentially morphed or evolved into what we now know as syncytin. This protein gives baby the ability to fuse cells into a wall — the placenta — that connects mom and baby but also keeps them separate.

“This virus helped that mammalian ancestor survive better by giving it a better placenta, then this piece of DNA would have been passed on to the [next] generation and eventually spread into the population,” Chuong said. “And this process we think of as a molecular domestication of an ancient retrovirus element. And this retroviral element continues to be important for placental development in modern humans.”

It’s worth noting this probably didn’t happen overnight. This was the key step, but it probably took many more generations worth of mutations. But it’s more than placentas … biologists have found huge chunks of our DNA that are actually remnants of ancient viral infections.

Looks like we’ve been domesticating viruses for a long time. Or have viruses been domesticating us? Either way, what all that DNA is doing for us is, for the most part, still a mystery.

“It just seems like in a way we’re part virus, otherwise we’d be laying eggs,” Coolahan said.