One of the peculiar practices of human society is that of sacrifice. Humans perform sacrifices, we hear, because the gods need or demand it. The most repugnant sacrifices, those of adults and children, have nearly vanished, or at least been banished to lunatics and the most benighted corners of the world, but there is plenty of evidence that such sacrifices were practiced all over the world, in the early civilizations - in Europe, Africa, the Middle East, the Americas, and Asia. See, e.g., Wikipedia here.
As civilizations advance, they mostly turned away from human sacrifice, and it became a badge of barbarism, awarded fairly or unfairly to one's opponents. In the versions of the tales that have come down to us, the sacrifices of Isaac and Iphigenia were aborted by divine intervention, but it's easy to believe that those sacrifices were quite real in some original versions.
Many major religions of today, including Christianity, Islam, Hinduism and Judaism preserve remnant sacrificial processes, though in many cases the sacrifices have been reduced to symbolic rituals.
The idea of voluntary self-sacrifice found its apotheosis in the self-sacrifice of an actual god and may have originated in the Middle East or perhaps India and became the foundation myth of Christianity. This form of human sacrifice has proved more durable. The gods, it seems, still need the lives and blood of martyrs and suicide bombers.
As always, I ask the question: what is the evolutionary rationale for this sort of thing?