In primitive societies, such crises were resolved by the "scapegoating mechanism," in which the community, en masse, turned on an unpremeditated victim. The repression of this collective murder and its repetition in ritual sacrifice then formed the foundations of both religion and the restored social order.