We present a theory of the origin and evolution of infant-directed song, a form of music found in many cultures. After examining the ancestral ecology of parent-infant relations, we propose that infant-directed song arose in an evolutionary arms race between parents and infants, stemming from the dynamics of parent-offspring conflict. We describe testable predictions that follow from this theory, consider some existing evidence for them, and entertain the possibility that infant-directed song could form the basis for the development of other, more complex forms of music.