The story of Adam's two sons, Cain & Abel, is a miniature story of Yahweh's two sons, Israel & Jesus.
Cain is the firstborn, and is given precedence within the unfolding story. He is also given a name which resembles the theme of a new "creation." ("Cain" means "created" or "forged") Abel is the secondary, lesser son of the story, and is given a name by his parents which resembles this fact. Abel's name means "mist" or "vapor," which illustrates partly what must have been the expectation of is parents when they named him. Cain was the firstborn son, the son of promise, and was therefore named in light of a new creation and hope for Adam's seed--hope that Cain would strive alongside God and conquer evil in the land for the glory of Yahweh. Abel, on the other hand, is given the name that implies striving with the wind, a life that is fleeting and vanishes away like vapor.
A similar image of Jesus and Israel is given to us as well. Israel was Yahweh's firstborn son, the son of promise. Israel was "created" by God to be the hope of the nations, conquering God's enemies and bringing rest in the land for the glory of Yahweh. Israel even means "one who strives with God" or "God strives." Jesus' name means "Yahweh saves" and is related to the word which means to "cry out to Yahweh." Jesus is the greater Abel who cries out to Yahweh for help, and whom Yahweh saves. Israel, on the other hand, is the one who strives with God but fails to enter God's rest because of his evil deeds, becoming the one with whom God strives against.
Another parallel idea is seen in the offerings of Cain and Abel. Cain offers to Yahweh a tribute offering all by itself, whereas Abel offers an entire animal with it's best portions--it's fatty portions--along with his tribute offering (which is reminiscent of the required ascension offering and tribute offering together on Yahweh's altar). Because of this act of faith, Yahweh reckons Abel as "just" for his offering. Cain, on the other hand, is not accepted because of his offering. Cain offers the work of his own hands and nothing more, as though Yahweh should accept Cain's own works alone before he offers anything more (an ascension offering perhaps??). Cain has faith in his own works alone, which is the same thing as saying that Cain has faith in himself, not Yahweh.
Cain is then given a warning and a subsequent opportunity to repent of his angry countenance: Sin is crouching at the door, but he can rule over it. He can overcome it by doing what is good, offering to Yahweh what is acceptable and pleasing in His sight. We all know the way Cain responds to Yahweh's merciful warning though. Like Israel with Jesus, Cain slays Abel because his deeds are righteous. And like Yahweh's treatment of Cain, Israel was given an opportunity to repent and turn to Christ in faith before he was cut off from the people of God.
Adam's firstborn destroyed the brother who was least esteemed, just as Israel--Yahweh's firstborn--did with Jesus. And just as the blood of Abel cried from the ground after his brother slew him, and still speaks to us today (Gen. 4:10; Heb. 11:20), even so the blood of Jesus speaks today as well (Heb. 12:24). Like Abel's righteous blood which cried out to Yahweh for justice after Cain slew him, and was heard because of his righteous deeds done in faith, even so Jesus' blood cried out and was heard by Yahweh. Yahweh then saved him from the grave because he was just, because his deeds were righteous altogether, because he literally offered the best sacrifice before Yahweh--the sacrifice of himself as the spotless lamb--along with his tribute offering, his works done in faith.
Moreoever, just as Adam fathered a son named "Seth" (meaning, "appointed one") in his own likeness, after his image, even so Jesus, the second Adam, would appoint children to walk faithfully in his footsteps, in his own likeness, after his image.