Prosocial acts benefitting others are widespread amongst humans. By contrast, chimpanzees have failed to demonstrate such a disposition in several studies, leading some authors to conclude that the forms of prosociality studied evolved in humans since our common ancestry. However, similar prosocial behavior has since been documented in other primates, such as capuchin monkeys. Here, applying the same methodology to humans, chimpanzees, and capuchins, we provide evidence that all three species will display prosocial behavior, but only in certain conditions. Fundamental forms of prosociality were age-dependent in children, conditional on self-beneficial resource distributions even at age seven, and conditional on social or resource configurations in chimpanzees and capuchins. We provide the first evidence that experience of conspecific companions' prosocial behavior facilitates prosocial behavior in children and chimpanzees. Prosocial actions were manifested in all three species following rules of contingency that may reflect strategically adaptive responses.