Understanding the roots of prosocial behavior is an interdisciplinary research endeavor that has generated an abundance of empirical data across many disciplines. This review integrates research findings from different fields into a theoretical framework that can account for when prosocial behavior is likely to occur. Specifically, we propose that the motivation to cooperate is generated by the reward system in the brain (extending from striatum to the ventromedial prefrontal cortex), and that it can be modulated by two neural networks: a cognitive control system (centered on the lateral prefrontal cortex) that processes extrinsic cooperative incentives, and/or a social cognition system (including the superior temporal sulcus, the anterior medial frontal cortex and the amygdala) that processes trust signals. The independent modulatory influence of incentives and trust on the decision to cooperate is substantiated by a growing body of neuroimaging data and reconciles the apparent paradox between economic versus social rationality in the literature, suggesting that we are in fact wired for both. Furthermore, the theoretical framework can account for substantial behavioral heterogeneity in prosocial behavior. Based on the existing data, we further postulate that self-regarding individuals (who are more likely to adopt an economically rational strategy) are more responsive to extrinsic cooperative incentives and therefore rely relatively more on cognitive control to make (un)cooperative decisions, whereas other-regarding individuals (who are more likely to adopt a socially rational strategy) are more sensitive to trust signals to avoid betrayal and recruit relatively more brain activity in the social cognition system.