We know, then, it was not an accident that Abel's sacrifice was accepted and Cain's wasn't. Abel had learned what was acceptable to God, and why. Cain was upset and disappointed that his way was not accepted.
Cain tried a different path. God is no respecter of persons. (Acts 10:34) He will accept anyone. And, people have lots of freedom within the rules. The important part there, however, is that it must be within the rules.
Adam and Eve had only one thing they couldn't do in the Garden of Eden. they went against that, and brought sin into the world. they were insistent on doing things their own way. That way was sin, and God is so holy that He can't come in contact with sinin any way. That's why sacrifices were needed right away to cover sin, until Christ came as the Lamb of God.
Cain didn't do that. His sacrifice was another sign of people choosing their own way, instead of following God's way. There was nothing terribly hard about doing this God's way. It was going to be by faith, anyway. So, if Cain couldn't get a lamb, he could always borrow a lamb from his brother.
Cain insisted on doing it his way, however. Thus, the Bible says that God not only had no respect unto the sacrifice, but also no respect unto Cain himself. Cain was not yet justified.
We who have received Jesus Christ's forgiveness are all justified by faith. We have Christ's perfect righteousness placed on us. God is able to look on us in a way He can't look on sin because of His holiness. That's because when He sees us, He sees the Holy Spirit living in us. It is the earnest - the promise - of our salvation. The Spirit is the proof God will one day take us home to be with Him. He can't see sinners the same way. That redemption was future for Cain and Abel, but God was still able to see Abel's faith and look favorably on Abel, because Abel - in performing the sacrifice he did - was justified by faith.
Cain was really mad about this. He wanted things his own way. Also, he may also have felt some entitlement, being the firstborn, as is human naturem. His countenance fell. He was gravely discouraged at being rejected. Just as He had done with Adam and Eve, God goes in search of His lost sheep.