The vast literature on negative treatment of outgroups and favoritism toward ingroups provides many local insights but is largely fragmented, lacking an overarching framework that might provide a unified overview and guide conceptual integration. As a result, it remains unclear where different local perspectives conflict, how they may reinforce one another, and where they leave gaps in our knowledge of the phenomena. Our aim is to start constructing a framework to help remedy this situation. We first identify a few key ideas for creating a theoretical roadmap for this complex territory, namely the principles of etiological functionalism and the dual inheritance theory of human evolution. We show how a "molecular" approach to emotions fits into this picture, and use it to illuminate emotions that shape intergroup relations. Finally, we weave the pieces together into the beginnings of a systematic taxonomy of the emotions involved in social interactions, both hostile and friendly. While it is but a start, we have developed the argument in a way that illustrates how the foundational principles of our proposed framework can be extended to accommodate further cases.