Something really jumped out at me as I read about Cain recently.
A few things that Cain battled with were pride, rebellion, selfishness, jealousy.
He decided one day that he would sacrifice what he wanted to sacrifice to the Lord - not what the Lord had taught his father to sacrifice. He wasn't about to do it that way. It was as if he thought he knew better than any one else, even than the Lord.
I will sacrifice what I want to sacrifice. I will give up what I want to give up. These seemed to be his thoughts. He took his crops to the altar and laid them before the Lord.
Guess what - nothing happened.
The Lord did not accept them.
This affected Cain's attitude even more.