More than 120 million years ago, while giant dinosaurs crashed through the forests in fearsome combat, a quieter drama unfolded in the Cretaceous underbrush: some lineage of hairy, diminutive creatures stopped laying eggs and gave birth to live young. They were the progenitors of nearly all modern mammals (the exceptions, platypuses and echidnas, still lay eggs to this day).

What makes mammals’ live birth possible is the unique organ called the placenta, which envelops the growing embryo and mediates the flow of nutrients and gases between it and the mother via the umbilical cord.

The placenta seems to have evolved from the chorion, a thin membrane that lines the inside of eggshells and helps embryonic reptiles and birds draw oxygen. Kangaroos and other marsupials have and need only a rudimentary placenta: after a brief gestation, their bean-size babies finish their development while suckling in the mother’s pouch. Humans and most other mammals, however, require a placenta that can draw nutrients appropriately from the mother’s blood throughout an extended pregnancy.

Recent studies have shown that the sophistication of the placenta stems in part from how different genes within it are activated over time. Early in embryonic development, both mouse and human placentas rely on the same set of ancient cell-growth genes. But later in a pregnancy, even though the placenta does not obviously change in appearance, it invokes genes that are much newer and more species-specific. Thus, placentas are fine-tuned for the needs of mammals with different reproductive strategies: witness mice, which gestate for three weeks with a dozen or more pups, versus humans, who deliver one baby after nine months.

To last more than a week or two, the placenta, which is primarily an organ of the fetus, must prevent the mother’s immune system from rejecting it. To do so, the placenta may deploy a mercenary army of endogenous retroviruses—viral genes embedded in the mammal’s DNA. Scientists have observed such viruses budding from the placenta’s cell membranes. Viruses may play crucial roles in pacifying the mother’s immune system into accepting the placenta, just as they do in helping some tumors survive.