For vampire bats, the mark of true friendship is breaking bread—er, blood—together. These animals require their liquid meals to survive, and they require them often. If one misses a feeding just three nights in a row, it could starve to death. So the creatures have developed a friendly way to cope: sometimes well-fed bats regurgitate blood directly into the mouths of hungry companions. That blood may not be enough for a full meal, but it lets the recipient live and hunt another day. Now new research has tapped into the secrets of how vampire bats form these intimate bonds.

Plenty of animal parents regurgitate food for their offspring, but this kind of food sharing between unrelated adults is nearly unheard of in the animal kingdom, says Ohio State University behavioral ecologist Gerald G. Carter. Biologists have long wondered how such relationships form in the first place and how vampire bats maintain them, especially because the animals involved are not kin. Some unrelated bats have been seen traveling together for more than a decade.

“You could be investing time and energy helping a partner, but if they don’t cooperate with you, you could be worse off than if you never engaged at all,” Carter explains. “If you’re in that situation, what’s the best strategy for mitigating risk?” He is lead author on a new study of these bats’ cooperation, published Thursday in Current Biology.

About two decades ago, researchers put forth a hypothesis of animal social behavior called the “raising the stakes” model. It proposes that one individual begins by making small, low-cost investments in the relationship. If they are reciprocated, the animal gradually escalates to larger, higher-risk investments. If the relationship does not go well, it tries somebody new. “I think that’s a really intuitive idea for how individuals would form relationships, but it hasn’t really been tested properly,” Carter says.

To assess this hypothesis, Carter and his team trapped about 30 wild vampire bats from two different, unrelated colonies in Panama and then introduced pairs of unfamiliar bats to each other in the lab. Some of the animals quickly began grooming the stranger they were partnered with—just a little bit. In some pairs, grooming eventually gave way to food sharing. The latter was relatively rare, and it was always preceded by grooming, a much lower-cost investment. The amount of grooming rose sharply in the days just before the first instance of food sharing, and then it plateaued afterward. The researchers say these observations provide the first empirical support for the raising the stakes hypothesis.

“[This] study makes the point that reciprocity is not some cold calculation of tit for tat but ultimately rests on trust that is built up over time,” says Emory University primatologist Frans de Waal, who was not involved in the new paper. “It is part of an emotional, close relationship, as is also speculated for the primates. Grooming among primates may do the same as in the bats: prepare relationships for occasions when mutual assistance is truly needed.” Carter agrees, noting that even after the bats were returned to the wild, many maintained the relationships they initially formed in captivity.

Carter suggests that this kind of study might help biologists better understand human relationships as well. “The quality and quantity of the social bonds you have with others is really important for your health, for your reproduction, for your survival,” he says. “But nobody really understands how you get relationships: How much is luck? How much is personality? This is the next frontier, I think.”