Providing help to others at a risk to oneself can be observed throughout the animal world. One possible explanation for this is the theory of reciprocal altruism. This theory is associated with the delicate balance of costs and benefits. The proposition is that altruistic acts which are costly in the immediate sense provide long-term benefits if the altruistic behavior is returned. This theory, developed by Robert Trivers, takes into consideration not only genetic impulses but also emotions and psychological processes.
Nonhuman primates exist in hierarchically structured communities with strong mutual attachments.
For lesser individuals to gain an advantage, they would have to do something for another individual, and this act would hopefully eventually result in a pattern of reciprocal altruism and the formation of a lasting and mutual beneficial alliance. As De Waal discusses in Good Natured, the first helpful act in the theory of reciprocal altruism is a gamble. Reciprocal altruism differs from other patterns of cooperation in that it involves risk. It depends on the idea of trust and friendship. If a partner in a mutually beneficial alliance decides to engage in a behavior which is detrimental to that alliance, some sort of punishment usually follows, whether it be as obvious as a beating or as slight as mere avoidance.