Researchers have turned up numerous surprising health benefits of friendship—from fending off colds to coping with chronic disease. Yet not all friendships are created equal. The nature of our social ties determines whether they help—or hurt.

The Findings
Several large studies have found that friends contribute to a healthy life. For example, a famous longitudinal study of 15,000 septuagenarian Australians, published in 2005, found that the size and strength of a person’s circle of friends, but not necessarily his or her family, predicted survival a decade later. Similarly, a 2010 meta-analysis (a quantitative review) found that in data across 149 studies, having strong relationships, whether friends or family, was as powerful an indicator in predicting longevity as smoking or abusing alcohol.

The Mechanism
Several theories have sought to explain why your circle of friends can keep you healthy. One account holds that friends reinforce healthy behaviors—gym buddies help you maintain an exercise routine, for example. Yet habits are just as contagious when they are bad. A 2007 study in the New England Journal of Medicine revealed that the behaviors that contribute to obesity also spread within social groups. Having a few companions who reinforce your most salubrious self, then, is more beneficial than belonging to a large network of gluttons.

Another interpretation is that friends offer stress relief, thus helping to ward off the physical toll of turbulent times. A 2012 study found that among 4,530 women diagnosed with breast cancer, women with strong social support—defined as having people who will listen, help out in times of sickness, or offer money or a place to stay when needed—had significantly lower rates of mortality than those without someone to turn to for comfort or aid. Yet women who spent their time with people who require a great deal of care—particularly children, siblings or parents—had higher mortality despite having many social connections.

The Proper Dosage
So how can we know if our social network is just what the doctor ordered? As the study on women with breast cancer illustrated, having a big social circle is not enough to reap the health benefits of friendship. A large network is helpful in that you are less likely to overburden one or two core companions. Yet an abundance of needy or unhealthy colleagues impairs well-being.

“The usual answer is that a person needs at least one confidante. More social ties are better than fewer, unless the networks are divisive,” says psychologist Shelley Taylor of the University of California, Los Angeles.  As is often the case, in friendship it is quality, not quantity, that matters most.