Polarization — right and left, red state and blue state, etc. — wasn’t invented yesterday. Ask the scientists studying the bones of prehistoric Europeans. Hundreds of skeletal remains , many from a newly discovered cave in Germany, have produced a startling reminder of the power of social boundaries.

When farmers showed up from the Near East about 7,500 years ago, eager to grow their grains in the soil of Central Europe, they were met by indigenous hunters and gatherers. The locals, apparently, did not welcome them with open arms.

Two new scientific techniques, ingeniously paired together, suggest that for some 2,000 years, these distinct groups refused to mesh and would rarely cross their cultural boundaries to find a mate.

At first, the indigenous people largely disappeared from the scene altogether, fleeing to the north to continue their traditional mode of life. But even when they drifted back and became neighbors with the farmers, they remained to a large extent a breed apart.

“We don’t really know who set up those social boundaries, so we don’t know if it was the farmers who didn’t mix with the hunter gatherers or if it was the hunter-gatherers who wanted to stay by themselves,” said Ruth Bollongino, a biologist at the University of Mainz and the lead author “2000 Years of Parallel Societies in Stone Age Central Europe,” one of two new papers on Neolithic Europe published online Thursday by the journal Science. “Or maybe its both groups that wanted to keep their own identity.”

This is an old story. Think of the plot of “Shane,” in which the ranchers do battle with the “sodbusters.” Recall the tensions between “the farmer and the cowman” in the musical “Oklahoma!”

Exactly how cultures clashed in prehistoric times is necessarily a foggy subject, given that no one had a written language and archeologists must piece together the story from broken pottery, tools, bones and charcoal.

But new research techniques are clarifying that story. The analysis of mitochondrial DNA from skeletal remains allows scientists to study migration patterns and lineages. Moreover, scientists can tell what people ate by studying variations in the carbon, sulfur and nitrogen isotopes in their teeth and bones. They can tell, for example, if a diet was heavy in fish or heavy in grains.

An enduring debate for decades has been whether agriculture arose in Europe through “cultural diffusion,” in which the techniques of farming and animal husbandry were adopted by the indigenous population from distant sources, or whether an entirely new population of people rolled into that part of the world and pushed out the natives. The second paper published Thursday in Science, reporting an analysis of hundreds of skeletal remains from multiple sites in Central Europe, provides evidence for the second scenario, which likely involved some degree of unpleasantness.

“There’s certainly a big culture clash at that time,” said Wolfgang Haak, a geneticist at the University of Adelaide and co-author of that paper. “Farmers are probably loud, noisy and stinky at the same time. They come with domestic farm animals and just take over the place.”

Spencer Wells, explorer-in-residence at the National Geographic Society, and project director of the Genographic Project, a human-migration research effort that contributed to the second paper, called the new findings “a huge insight.”

“In my opinion, certainly for the case of Europe, it’s going to be the nail in the coffin of this cultural diffusion idea,” he said.

The “parallel societies” evidence is based on skeletal remains found in a cave near the German city of Hagen. The cave, called Blätterhöhle, or Leaf Cave, has a long, narrow entrance, and was not discovered until 2004. Excavators found more than 400 skeletal remains. The DNA evidence showed that some people were descendants of hunter-gatherers and some were from the farming lineage.

Then came the surprise. Bollongino assumed that she and her colleagues would wind up writing a paper about the mixing of these populations. But instead, the isotopic analysis showed that the people from the hunter-gatherer lineage were still living that way, with a diet relying heavily on fish, and the people from the farming lineage continued to be farmers. Everyone stuck to their way of life and rarely interbred.

“It wasn’t until we saw the isotopes that we realized we were going to have to rewrite the paper completely,” Bollongino said. “They shared the same burial place for something between 400 and 600 years, so it would be very hard to explain that they did not know each other. We believe that they were close neighbors and had contact with each other and traded with each other. But still they didn’t mix.”

The moral of the story?

“Apparently most humans need to have some kind of identity, or some kind of group that they belong to and they feel part of. I think keeping up this identity also means that you do not admix with people from other groups, from other cultures,” she said.

Joel Achenbach covers science and politics for the National Desk. Achenbach also helms the "Achenblog."