The writer describes the two types of work that the two brothers engaged in. Abel was a shepherd and Cain was a farmer, and the account does not say that one activity was more godly than the other. The order that is given in this passage of mentioning work and then worship is a reminder that work is not the highest goal of humans. Worship of God is the most important purpose.
The passage also indicates that an aspect of worship is to give to God from what we obtain by our labour. In our society, the way we give is with money. The idea is that we give to God out of the blessings and functions he has given us.
Verse 3 indicates that there was both a time and a place for this aspect of worship. It is generally assumed that the time was the Sabbath and the location was the place where God had positioned the cherubim at the entrance to Eden.
It is very likely that God had indicated how the two brothers were to worship. It is not clear if an animal sacrifice was required. Some suggest that ‘if you do well’ in verse 7 refers to obedience to a previously-given instruction which Cain had ignored, and if that is the case then Abel had followed the required manner of offering a sacrifice for his sin. Yet it is the case that later, in the Levitical system, sacrifices composed of grain were expressions of thankfulness and dedication, and may have been acceptable to God in Genesis 4. Elsewhere the Bible states what the real difference was, their characters. In Matthew 23:11 Jesus describes Abel as righteous and Hebrews 11 says that he worshipped by faith. 1 John 3:12 says that Cain belonged to the devil and was evil in character.
Yet although Cain’s attitude was wrong, it is important that we note the Lord’s reaction to him. His response contains both encouragement and warning. He was not put off by Cain’s sullen attitude. In mercy the Lord draws near his sinful creature and assures him that the way is open for his acceptance. Cain deserved to be punished, but instead the Lord responded graciously. This is a reminder to us, even as we are engaged outwardly in an act of worship, yet perhaps with wrong attitudes, that the Lord, who reads our hearts, desires to reveal his grace to us.
Sadly, Cain chose to ignore God’s warning and this response had horrible consequences. Instead of imitating his brother, he murdered him. Cain's downward spiral can be seen in that his disobedience to God led him to become defiant of God, which led him to despair because he was rejected by God. That is an awful descent, one that has been imitated by many millions down the centuries.