With two different humans living side-by-side, it was bound to happen eventually: A glance here, a smile there, and sure enough, Homo sapiens ended up interbreeding with Neanderthals, who co-existed with modern humans for thousands of years before dying out 30,000 years ago. But far from being a mistake, researchers now believe that co-mingling our genes with those of our cave-dwelling cousins helped us survive, according to a recent study published in the journal Science. Here, a guide to this research:

Are scientists sure we mated with Neanderthals?
Yes: The proof is in our DNA. As much as four percent of the DNA in some people now living was originally Neanderthal, according to the study. Importantly, some of that DNA is found in the part of the human genome known as the HLA (human leucocyte antigen) sequence of genes, which plays a critical role in our immune defenses. "The cross-breeding wasn't just a random event," says lead researcher Peter Parham of Stanford University, as quoted in the Daily Mail. "It gave something useful to the modern human."

How did we end up with Neanderthal disease-fighting genes?
Through migration. Ancient groups of Neanderthals living in Europe and Asia were exposed to a number of viruses and bacteria that weren't found in Africa. They developed a resistance to these infections that Homo sapiens living in Africa didn't possess. When modern humans migrated out of Africa into Europe and Asia, scientists theorize, interbreeding allowed them to quickly pass on the local Neanderthals' immune defenses to their children.

Are Neanderthals the only group we humans interbred with?
No: We apparently had a wandering eye, and also bred with another ancient group of now-extinct cousins called the Denisovans, who are known only through the DNA found in a single tooth and finger bone fragment discovered in a Siberian cave in 2008. This back-and-forth pattern of migration and interbreeding shows that human history was "a lot more complex and interesting" than previously thought, says anthropologist Svante Pääbo of the Max Planck Institute for Evolutionary Anthropology, as quoted by Discovery News

Sources: BBC News, Daily Mail, Discovery News, LA Times