Here is the story as recounted in the bible. Both Cain and Abel came to worship before the Lord, both brought a sacrifice. But there was a difference. Cain brought a sacrifice of the fruit of the ground. His offering was a bloodless sacrifice. However, Abel brought forth a bloody sacrifice, and the fat thereof.
And why was that?
Moses’s record supposedly makes it easy to understand what the problem was. The written account specifically denotes the differences between their offerings. One was of produce, the other was a blood-bearing sacrifice. And the god of the bible loves blood. He is always very excited when blood is involved. However, we are never told why a blood-bearing sacrifice is better. Cain is also never told not to offer produce instead of a blood sacrifice. Instead, the god of the bible just rejects Cains offering. Here is what he says to Cain. "Then the Lord said to Cain, “Why are you angry? Why is your face downcast? 7 If you do what is right, will you not be accepted?"
Where does it say why the offering is unacceptable?
Since god knew that Cain would kill Abel after he rejected Cain's offering, he is the one responsible for death of Abel in the story.