Genesis 4:1 - 26
NKJV - 1 Now Adam knew Eve his wife, and she conceived and bore Cain, and said, "I have acquired a man from the LORD. 2 Then she bore again, this time his brother Abel. Now Abel was a keeper of sheep, but Cain was a tiller of the ground.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
By faith Abel offered to God a more excellent sacrifice than Cain, through which he obtained witness that he was righteous, God testifying of his gifts. (Hebrews 11:4)
Abel's gift testified that he was in right relationship with God. He gave God the best of himself and his products. Cain didn't. His gift was as bland as he was. But it had nothing to do with not bring something that he didn't even raise. Cain wasn't expected to trade his products for an animal to bring to God. That wasn't the problem. It was his whole disposition. Blood sacrifice is for the remission or forgiveness of sin. But there are more offerings to be made to God. Cain and Abel's offerings sound like offerings of thanksgiving, to me.
Where there is no law there is no trespass. No law of offering had been established by covenant. God sees the heart. Therefore disposition is a plausible answer for the response God gives Cain and Abel.