The Lord said to Cain, "Why are you angry, and why has your face fallen? If you do well, will you not be accepted? And if you do not do well, sin is crouching at the door. Its desire is for you, but you must rule over it."
I find it interesting that the conversation that we have recorded in this passage is not between God and Abel, but between God and Cain. When we read in the text that God was not pleased with Cain's sacrifice, we would think that God would have also been uninterested in pursuing anything with Cain, but that is not the case. In fact, these verses show us quite the opposite situation. God was interested in helping Cain understand what it would take to be right with Him. He is conversing with the rebel heart, drawing it to Himself.
Cain was angry, and I surmise that Cain's heart was not where it should have been prior to this conversation. His sacrifice was certainly the KIND of sacrifice God was pleased with. Many of the levitical offerings concerned fruit and grain offerings. But it was the heart behind the sacrifice that clearly was the problem, as evidenced by Cain's anger over God's response. It seems Cain had hoped to get by with some sort of physical worship without spiritual engagement. And that is what God corrects with this conversation.
Cain's anger was at God, not himself. God encouraged him to "do well", which was a call to repentance. God promised through the rhetorical question to accept what Cain might have offered with an attitude of "doing well". But Cain was going through the motions, content to let sin crouch at the door. God's warning was that if he was not careful, sin would overtake him like a wild beast. By "doing well" and serving God, he could instead tame it and rule over this dominating sin. But ultimately Cain did not agree with God. And God’s imagery of the wild beast would be all to real… Cain would be that beast.
Of course the result was the first murder, a fratricide, and even then God's mercy came to Cain again. God graciously spared his life for the sake of the human race, but Cain sadly did not seem to learn what it truly meant to worship God and conquer life-dominating sins.
So with Cain we see God's early emphasis on the heart of humanity. It is who we are at the heart that God seeks to help us know, respond to Him with, and cultivate in righteousness.