Cain hated Abel because Abel’s deeds were righteous.
How did he know that Abel’s offering was accepted? Fire would have come down on the altar and consumed Abel’s gifts, the firstling of the flock with the blood and the fat portion,
"And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the Lord had respect unto Abel and to his offering." Gen 4:4
Apparently, there was more told to them than just what we see in Genesis. Genesis is a summary, but there was more communicated that God did not preserve in the testimony. Abel was the first prophet who believed in the Seed and The Blood. He didn’t take the way of the flesh or the works of the flesh. He took the testimony of Christ. That was the Gospel at that time.
Galatians 3 tells us that the “Scripture preached the Gospel beforehand to Abraham” (Gal 3:8). There weren’t any scriptures at the time of Abraham. But there was the Word of God, who was a Person who actually appeared to people in the Old Testament and spoke to them. That was Christ. He promised Abraham that in his seed, the nations would be blessed. According to Galatians 3, That seed is Christ (Gal 3:16). God made a covenant with that seed (Christ), called the “everlasting covenant.” Christ is the Word that made the promise, and Christ is the Seed to inherit the promise! He is everything.
"Now to Abraham and his seed were the promises made. He saith not, And to seeds, as of many; but as of one, And to thy seed, which is Christ." Gal 3:16
Read the book Here ???? Romans 1-8: Christ Our Righteousness in Heaven – Our Life on Earth