Socioecological models assume that primates adapt their social behavior to ecological conditions, and predict that food availability and distribution, predation risk and risk of infanticide by males affect patterns of social organization, social structure and mating system of primates. However, adaptability and variation of social behavior may be constrained by conservative adaptations and by phylogenetic inertia. The comparative study of closely related species can help to identify the relative contribution of ecological and of genetic determinants to primate social systems. We compared ecological features and social behavior of two species of the genus Sapajus, S. nigritus in Carlos Botelho State Park, an area of Atlantic Forest in São Paulo state, and S. libidinosus in Fazenda Boa Vista, a semi-arid habitat in Piauí state, Brazil. S. libidinosus perceived higher predation risk and fed on clumped, high quality, and usurpable resources (fruits) all year round, whereas S. nigritus perceived lower predation risk and relied on evenly distributed, low-quality food sources (leaves) during periods of fruit shortage. As predicted by socioecology models, S. libidinosus females were philopatric and established linear and stable dominance hierarchies, coalitions, and grooming relationships. S. nigritus females competed less often, and could transfer between groups, which might explain the lack of coalitions and grooming bonds among them. Both populations presented similar group size and composition and the same polygynous mating system. The species differed from each other in accordance with differences in the characteristics of their main food sources, as predicted by socioecological models, suggesting that phylogenetic inertia does not constrain social relationships established among female Sapajus. The similarity in mating systems indicates that this element of the social system is not affected by ecological variables and thus, is a more conservative behavioral feature of the genus Sapajus. Am. J. Primatol. 74:315–331, 2012. © 2011 Wiley Periodicals, Inc.