There wasn’t any real reason for the biblical Cain to behave like this other than stubborn pride. The biblical Cain could well have bartered his fruits and vegetables for some of the biblical Abel’s livestock, and both brothers would have been able to make sacrifices that were copacetic with God.
Just read this part last night, God told Cain to just “do what is right” and everything would be fine. Sounds like me talking to my rebellious offspring.
Gen 4:6-7
6 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? But if you do not do what is right, sin is crouching at your door; it desires to have you, but you must master it.