Sibling rivalry is a part of growing up (unless you were an only child I suppose). It has many causes and can take on many forms. It has been said that children are keenly aware of how they are treated by their parents versus how their siblings are treated, and it may only take one perceived act of favoritism to spark a fire.
What is fascinating to me about the story of Cain and Abel is that their parents, Adam and Eve, are barely mentioned at all. They are still alive of course, as the list of descendants in Genesis 5 attests to the fact that Seth (and other children) were born to Adam and Eve after Cain and Abel. Adam and Eve were also aware of the incident (Gen. 4:25). Yet curiously, it is God who acts as the parent in this story.
When Cain and Abel bring their offerings to God, and Abel’s offering is accepted, but Cain’s is not, this appears to be interpreted by Cain as favoritism by God (again, acting the picture of the father). Then it is God, not Adam, who steps in and inquires of Cain why he is upset and gives him advice. Then, after a terrible display of free will, Abel is no more. Afterward, just like a dad, God questions Cain and gives him the opportunity to confess the wrong he has done. Cain then, being belligerant, talks back to God as a child would to his earthly father. God then explains that the evidence is damning; He knows what happened and He knows Cain is guilty.
So though God is both omnipotent and omniscient, He acts the part of the father by A) not preventing Cain from making this terrible mistake, and thus allowing him to learn from this experience; and B) He questions Cain diplomatically, even though God knows all things.
And lastly, like an earthly father, God, not Adam, hands down the punishment to Cain. And in an act of mercy, like a father, God relents a bit and gives Cain a mark of protection so that even though he is a murderer and deserves death, his life will be spared.
In Genesis 5 we get a picture of Cain’s life after this event: he has a wife, children and grandchildren; he builds a city, and his family embraces various trades (“Cain” means “smith” where we would likely get our term for such jobs as “blacksmiths”, etc.). Several generations of Cain’s family live, apparently peacefully, until the flood in Genesis 6.