Tolerant food sharing among human foragers can largely be explained by reciprocity. In contrast, food sharing among chimpanzees and bonobos may not always reflect reciprocity, which could be explained by different dominance styles: in egalitarian societies reciprocity is expressed freely, while in more despotic groups dominants may hinder reciprocity. We tested the degree of reciprocity and the influence of dominance on food sharing among chimpanzees and bonobos in two captive groups. First, we found that chimpanzees shared more frequently, more tolerantly, and more actively than bonobos. Second, among chimpanzees, food received was the best predictor of food shared, indicating reciprocal exchange, whereas among bonobos transfers were mostly unidirectional. Third, chimpanzees had a shallower and less linear dominance hierarchy, indicating that they were less despotic than bonobos. This suggests that the tolerant and reciprocal sharing found in chimpanzees, but not bonobos, was made possible by the absence of despotism. To investigate this further, we tested the relationship between despotism and reciprocity in grooming using data from an additional five groups and five different study periods on the main groups. The results showed that i) all chimpanzee groups were less despotic and groomed more reciprocally than bonobo groups, and ii) there was a general negative correlation between despotism and grooming reciprocity across species. This indicates that an egalitarian hierarchy may be more common in chimpanzees, at least in captivity, thus fostering reciprocal exchange. We conclude that a shallow dominance hierarchy was a necessary precondition for the evolution of human-like reciprocal food sharing.