Cain’s offering

How the story of Cain and Abel ends is well-known, but what about how it starts? And, even more importantly, why? Cain murders Abel because he is jealous that God has accepted Abel’s sacrifice and reject his. But, why did God reject Cain’s sacrifice?