We all need friends. Deeper and more numerous friendships promote health, well-being, survival, and even financial success. By the same token, social exclusion and the loss of social partners result in feelings similar to physical pain. Impairments in the ability or motivation to connect with others profoundly impact the lives of individuals with disorders like autism and shizophrenia. Yet despite its importance, the formalized scientific study of friendship is relatively new, perhaps due to the perceived difficulty of studying social behavior in the laboratory using the techniques of modern neuroscience. In my talk, I will discuss our work aimed at defining the biological mechanisms that mediate our ability and desire to connect. We directly compare biology and behavior in humans and rhesus macaques, using a complementary suite of brain imaging, eye-tracking, single-unit recording, pharmacological, and genetic techniques, in both the laboratory and the field. Our work has identified specialized circuitry that motivates attention to others, responds to cues to their intentions, and promotes prosocial decisions. The neuromodulators oxytocin and serotonin tune the gain of these circuits to regulate social interactions. In the field, we find that variation in social behavior and cognition has fitness consequences and emerges, in part, from genes that regulate neuromodulatory function. Together, our findings suggest deep homologies in the biological origins of complex social function in human and nonhuman primates.