According to Genesis, Cain killed his brother Abel and so God banished him to wander, but he was also given a mark so that “Anyone who kills Cain will be punished sevenfold” (4:15). His descendant Lamech then boasts to his two wives that just as Cain would be avenged seven times over for any injury, he would be avenged 7×7 times after a young man tried to injure him. What does this mark of vengeance represent?
The Cambridge Bible says this: “Cain were killed, seven deaths would be exacted in retaliation; the murderer and six of his family would forfeit their lives, cf. 2 Samuel 21:8. The words of Jehovah are noticeable, because (1) they emphasize the corporate responsibility of family life, which so often meets us in the O.T.; and (2) they recognize, but regulate, blood-revenge, as a disciplinary primaeval custom of Semitic life. This Oriental custom, while recognized in the O.T. as part of Israelite institutions, is continually being restricted by the operation of the spirit of love, gradually revealed by prophet and by law, in the religion of Jehovah.”
Now, why would the Bible associate that with Cain for murdering his brother Abel? For that answer, I think you have to look deeper at the symbolism. Cain is a farmer and Abel is a shepherd. There is a Sumerian equivalent to the story in which Enlil, the Lord of the Air, who is equivalent to the Canaanite El the Bull and Biblical Elohim, has two sons named Summer and Winter. Like Abel, Summer sacrifices animals and Winter sacrifices vegetables at Enlil’s Temple, but in the Sumerian version of the story, Enlil favors the farmer’s sacrifice, which makes sense since the Sumerians were city farmers and the Hebrews were a shepherd people. Cain also builds the first city Enoch east of the Tigris and the Euphrates. The first Sumerian city Eridu formed around the Temple to Enki, a wise god who provided Sumer with the magical arts of civilization, symbolic of the fruit of wisdom. In pre-Sumerian times he appears to have been worshipped by the Ubaid as a serpent-like god. Enki’s son Dumuzi was a dying-and-rising god who guarded the gates of heaven, only allowing Adapa, the Sumerian Adam, into heaven after Adapa sympathized with Dumuzi’s death, just as Cain’s son Enoch was the same name used by the Son of Man figure in the Book of Enoch. Dumuzi was also a shepherd who found himself in conflict with a city-reformed version of himself, Enkidu, over the love of the fertility goddess Inanna.
The conflict between Cain and Abel represents the conflict between city farmers and shepherds. This power struggle was unequal since the city farmers had more power. This was reflected by the city farmer killing his shepherd brother, represented in myth as the storm god slaying the multi-headed sea serpent. Eventually, Judah also accepted the storm god, as David and Jonathan both had sons with “Ba’al” in their name who were later given new names by embarrassed redactors. Just as Yahweh slew Leviathan, Hezekiah and Josiah rode out and destroyed the local religious pole shrines dedicated to the Tree of Life that Dumuzi was hung or “crucified” on, called “Asherahs”, after his wife (the Canaanite Inanna), in order to force people to worship Yahweh of Armies, in the Jerusalem Temple.
Thus, Cain represents the founder of cities, civilization, and kingly power, so the Mark of Cain probably represents the blood-revenge of kings and city-dwellers against homeless shepherds. The death of one city-dweller would typically mean the deaths of an entire family of shepherds as blood-revenge due to the power disparity. The same holds true for when the cities turned into empires, as Lamech was said to boast that 7×7 people would die in revenge for any hurt caused upon him. Consider the real life example of when one Palestinian murderer killed 3 Israeli teenagers in 2014, it brought about a war that resulted in almost 1,500 Gazan deaths where almost a third of them were children. When there is a power disparity, revenge from the powerful typically becomes 49 tits for 1 tat, or in this case, 490 tits per tat.