It’s even in the language: Our best friends are like family to us. We may not be blood, but we may as well be. Now science is finding some biological basis for this cultural truth, as research from the University of California, San Diego, and Yale University shows good friends share a surprising number of genetic similarities.

Researchers James Fowler and Nicholas Christakis teamed up to explore the Framingham Heart Study, a multi-decade longitudinal study taking place in Framingham, Mass., to understand how genetic variance occurs between friends and strangers. Their findings highlight the persistent and startling power of evolution, as good friends shared one percent of their genes — enough to put them on par with fourth cousins, or people who share great-great-great grandparents.

Fowler says he understands one percent may not seem like much. But he encourages people to consider just how large the human genome is — over three billion base pairs long. And it’s not even the similarities that make the findings so compelling, he says, but the differences thrown into the mix.

“There are certain parts of the genome in which we tend to be different, like the immune system, “ Fowler told Medical Daily, referring to the body’s natural tendency to find people with varied immune systems, in order to build as many walls as possible to different diseases. “So hidden in that average to be the same are really two competing forces. One is a tendency to be the same, and the other is to be different.” Saying the important genes are the ones that are the same is, in that sense, kind of a misnomer. “Birds of a feather flock together, and opposites attract,” he said. “Which is it? Well, it’s both.”

The team arrived at this conclusion after looking at the genetic makeup of 1,932 unique subjects, comparing pairs of unrelated friends against pairs of unrelated strangers. From the results, they developed a “friendship score,” which they believe can predict, through genetic similarities and differences, how likely two people are to become friends — a diagnosis not so dissimilar from the way schizophrenia or obesity may be predicted early.

The study comes with some limitations. Taken with a broad understanding, friendship may be an alright proxy for analyzing genetic differences — understood as meaningful interaction and emotional closeness. But friendship isn’t always the product of shared interests. Sometimes two people are close in geography before their genes have a chance to guide them toward one another or lead them astray. Lifelong friends tell this story. They developed similar interests together because they shared many of the same childhood experiences. By his own admission, friends who met in college explain Fowler’s findings slightly better.

On the other hand, while the analysis wasn’t powerful enough to discern lifelong friends from adult friends, Fowler suspects the same similarities would probably stick around. The trouble is in the analysis. Too often research falls prey to the “survivor bias,” or in other words, recognizing an elderly couple’s similarities, but failing to account for all the failed relationships in the past that might not have worked due to some genetic underpinning.

“The relationships that exhibit lots of dissimilarity are the ones most likely to be terminated,” he said.

The upshot is, from an evolutionary standpoint our bodies do a pretty remarkable job at picking and sorting people we should stick with. One of the strongest components in genetic similarity was a person’s sense of smell, for instance. From thousands of years ago, when we needed to stick together and a keen nose served us well, to the modern-day watering hole of a coffee shop, the story has stayed pretty much the same. Our genetics guide us toward safety, even if we find it at the bottom of a latte.

Source: Christakis N, Fowler J. Friendship and natural selection. PNAS . 2014.