Our mouths often just don’t have the space to accommodate all of our pearly whites—dental crowding is reportedly the most common reason for orthodontic referral and, along with malocclusion (a poor alignment of the teeth), affects one in five people.

Our ancient ancestors didn’t have these same problems. Rather, as a new study has demonstrated, up until about 12,000 years ago, humans had what one of the study’s lead authors called “an almost ‘perfect harmony’ between their lower jaws and teeth."

The big change, scientists say, came from civilization’s transition from hunter-gatherers to farmers. The study, published this week in PLOS One, analyzed “the lower jaws and teeth crown dimensions of 292 archaeological skeletons from the Levant, Anatolia and Europe, from between 28,000-6,000 years ago,” reports University College Dublin, where the study's lead author, Ron Pinhasi, is an associate professor of archaeology.

Pinhasi and his colleagues discovered a notable difference in jaw structure that coincided with the emergence of agriculture. As he says in a release:

"Our analysis shows that the lower jaws of the world's earliest farmers in the Levant, are not simply smaller versions of those of the predecessor hunter-gatherers, but that the lower jaw underwent a complex series of shape changes commensurate with the transition to agriculture."

Those changes likely came from diet, as previous studies have suggested. Hunter-gatherers needed big, strong jaws to chew the uncooked vegetables and meat that often made up their menu. Early farmers, on the other hand, had a softer diet, consuming cooked foods like beans and cereals that didn’t demand such a high level of mouth strength. Over time, as jaws became smaller in response to these dietary changes, teeth didn’t follow suit, remaining around the same size. This likely directly led to the problem of adequate mouth real estate so common today. We've got modern jaws but a potentially outdated number of teeth.

The switch to farming didn’t only cause changes to our jawbones. Two studies published last year found that the emergence of agriculture likely precipitated other skeletal changes in humans, causing lighter, less-dense bones, particularly around joints. Such developments appear to be due to both diet and changes in physical activity, particularly the more sedentary lifestyle allowed by farming and domesticating animals.

Some have argued (with a fair amount of push back) that civilization’s agrarian switch is the ultimate origin of many of society's ills. That’s a whole other bag of worms, but we know one thing for sure: Orthodontists probably wouldn’t be where they are now had our ancestors not made the fateful leap over to cultivation. The same clearly goes for the rest of us.