The point of the Cain and Abel story in Gen. 4 is not necessarily that this is the first murder in the Bible but that Adam and Eve’s descendants also were sinners in conflict with Yahweh, each other, and creation. Sin had so thoroughly corrupted humanity that the immediate children of Adam and Eve were desperately wicked, not enlightened as the serpent had promised.
Yahweh has brought the hope of redemption to Adam and Eve by teaching them that animal sacrifice covers sin, which means there is hope for the restoration of Yahweh’s kingdom. Satan thus desires to corrupt their descendants and to kill those who cannot be corrupted. He accomplishes both through Cain.
Yahweh did not accept Cain’s sacrifice because it was grain but because it was not a blood sacrifice for atonement like He had taught Adam and Eve. Abel presented a blood sacrifice for his sins and so was able to maintain his relationship with Yahweh. Cain was not so interested in offering up a costly sacrifice for his sins but offering “some” of his grain to appease Yahweh. Leviticus makes it clear that Yahweh does require a grain sacrifice – but only after a blood sacrifice. Remember the original audience of Jews who just came out of Egypt would have understood this passage in this way since Yahweh had just instructed them on the sacrificial system.
Just as with Adam and Eve, it was Yahweh who pursued Cain both before and after he murdered his brother. Yahweh demonstrates here both His desire for a relationship with us (and not to punish us) and that He will always seek us out first.
Because Cain refused to offer his best to Yahweh, the land would no longer offer up food to him. And just as he took a home from Abel, Yahweh took his home from him by making him a wanderer. Even so, Yahweh demonstrated mercy in the midst of the sin and judgment just as He had for Adam and Eve (Gen. 3:21). Though Cain was selfishly complaining about how bad it was for Him, Yahweh heard him and placed His mark of protection on Cain so that what he did to his brother would never happen to him.
However, Cain showed his lack of repentance by going out and building a city and putting down roots, which was completely contrary to Yahweh’s judgment on him.