The original scapegoat was a goat sent into the desert in Leviticus
Once a year, according to Leviticus, the High Priest loaded the sins of the whole people onto a goat and drove it into the wilderness towards a mysterious figure called Azazel. Older English Bibles rendered the word as scapegoat. That ritual sits inside a book devoted less to belief than to how people should act.
Leviticus is the third book of the Torah and of the Old Testament. Its Hebrew title, Wayikra, means And He called, taken from its opening word, while the English name travels through Latin from the Greek Septuagint and points to the Levites, the priestly tribe whose rituals it describes. Most of the text consists of speeches from God to Moses, set in the short span of about a month or six weeks after the Tabernacle was finished and before the Israelites left Sinai.
The book's concern is practice. Its underlying logic, echoing the Genesis creation account, is that God wants to dwell among people, and that carefully performed sanctuary rites make this possible provided the community avoids sin and impurity. Early chapters explain offerings first from the worshipper's side, then from the priest's. Next comes the consecration of Aaron and his sons, including the grim episode in which two of them, Nadab and Abihu, die for offering unauthorised incense.
Purity rules follow: certain foods, childbirth, some skin diseases, mildew on walls and cloth, and unusual bodily discharges all make a person or object unclean. The reasoning behind the dietary laws is unclear, but many of the other cases seem tied to a loss of life force, often blood. The Day of Atonement, in chapter 16, is the single day the High Priest may enter the Holy of Holies.
Scholars generally see the whole book as Priestly writing, with chapters 17 to 26, the Holiness Code, produced by a related school that stretched ritual terms into moral and theological ones. Many agree it grew over a long period before reaching its final form in the Persian era, 538 to 332 BC, though that dating is disputed. Jacob Milgrom argued influentially that its rules form a rational theological system with an ethical concern for the poor.
Source: Book of Leviticus