Why did God accept Abel's offering and not Cain's? In Genesis 4, we read the following account of Cain and Abel:


  So it came about in the course of time that Cain brought an offering to the Lord of the fruit of the ground. Abel, on his part also brought of the firstlings of his flock and of their fat portions. And the Lord had regard for Abel and for his offering; but for Cain and for his offering He had no regard. So Cain became very angry and his countenance fell.  Genesis 4:3-5


The story continues that Cain continued in anger and ended up murdering Abel.

So, Cain's offering was not accepted by God, while Abel's offering was.  Why was this so?  What was it about Cain's offering that made it unacceptable, what was it about Abel's offering that made it acceptable?
One interpretation is that Cain's offering was not selective but Abel's offering was of the best ("fat portions") of the special ("firstlings").  Under this interpretation, Abel considered God well worthy of special honor (which tends to be associated with love), while Cain may have viewed the sacrifice more as something to be done, an expected action that was satisfied (perhaps indicating a legalistic inclination, perhaps something like the older brother in the Parable of the Prodigal Son).  Abel's offering of "firstlings" may also have indicated his understanding that the produce of his flock was a gift from God.

Another interpretation--which I do not believe to be accurate--is that Abel's offering involved blood, indicating a recognition of his need for atonement.  This interpretation seems not to account for the special aspects of Abel's sacrifice (and the context gives no indication that the "offering" was one for sins, though likewise it does not specifically indicate thanksgiving).

Even if one views the passage as not clearly giving the reason for God's favor to Abel, the general message of Scripture is that God "looks at the heart" (1 Sam. 16:7) and so one can assume that God's favor coincided with Abel's loving and faithful heart.  In fact, assuming that the type of sacrifice itself is what wins God's favor would be wrong-thinking because he does not benefit from such sacrifices (e.g., Psalm 50:9 [NIV]: "I have no need of a bull from your stall or of goats from your pens,") but seeks a heart-sacrifice (e.g., Psalm 51:17 [NIV]: "The sacrifices of God are a broken spirit; a broken and contrite heart, O God, you will not despise.") of which outward sacrifice is to be a fruit.

In addition, Hebrews 11:4 indicates that the offering came from faith, a trait of the heart without which "it is impossible to please God" (11:6) [NIV]:


  By faith Abel offered God a better sacrifice than Cain did.  By faith he was commended as a righteous man, when God spoke well of his offerings.