Stress causes us to do a lot of weird things, like scratching somewhere on our body that isn’t itchy. But scientists may have solved the mystery of this one stress-induced behavior, after watching a bunch of monkeys.

A study in the journal Scientific Reports suggests that rhesus macaques who scratched while in stressful situations were less likely to have aggressive interactions with other monkeys. The scientists say it could be that other macaques pick up on the stress signal from their comrades.

“Potential attackers may avoid attacking stressed individuals as stressed individuals could behave unpredictably or be weakened by their state of stress (rendering aggression risky and/or unnecessary),” according to the study. “Observable stress behavior could … have additional adaptive value by reducing the potential for escalated aggression, benefiting both senders and receivers by facilitating social cohesion.”

Monkeys identifying when others in their community are stressed — and subsequently not bothering them — could be a window into the evolution of empathy, and thus into social behavior as a whole.

“Stress is a biological response to the physical and physiological challenges animals face in their environment, and often specifically refers to a disruption of an animal’s homeostasis,” the study notes. That can include a shortage of resources, conflicts with other animals or separation from a mother, among other stressors. Some animals may repeatedly scratch when they find themselves stressed out.

In addition to the psychological relief scratching may offer, such as distracting a macaque from its situation, the study says it could serve as an alert system: “Given the overt visual nature of scratching, there is also potential for these behaviors to alert others to the state of the scratcher, and therefore have communicative function within a social environment. Scratching could act as a cue.”

Its potential guidance in social interactions would be why evolution would favor that ingrained behavior and keep it in the gene pool.

The researchers found that macaques in Puerto Rico scratched more when they were around higher-ranking members of their group or were around strangers — when there was more potential for social conflict. And the scratchers more often had positive social interactions, rather than aggressive ones, after their scratches.

According to the scientists, the macaques were responding immediately on a social level to the scratching, showing that it encouraged amicable interactions and deterred aggressive ones.

“Conflict is extremely costly, in both energy expenditure and risk of injury, and behavioral strategies to avoid and reduce physical conflict are common throughout gregarious animals,” the study says. “These findings suggest that stress-related behaviors are potentially functional, not only for the regulation of internal states, but also in communication with others.”

Much like monkeys, some humans also scratch when they experience anxiety. If macaques use scratching as a social signal, it’s possible humans are subconsciously using it and other visible stress-induced behaviors in the same way.

“Showing others you are stressed could benefit both the scratcher and those watching, because both parties can then avoid conflict,” researcher Jamie Whitehouse said in a statement from the University of Portsmouth. “By revealing stress to others, we are helping them predict what we might do, so the situation becomes more transparent. Transparency ultimately reduces the need for conflict, which benefits everyone and promotes a more socially cohesive group.”