I always wondered how Cain knew that his sacrifice wasn't acceptable. Apparently, Abel's sacrifice was consumed by a fire from Heaven as a token of being accepted by the Lord. Elijah also demonstrated this with his water-soaked offering. Such "divine fire' was considered a manifestation of the Lord's presence among the people. That this was a pattern is shown below.
And there came a fire out from before the LORD, and consumed upon the altar the burnt offering and the fat: which when all the people saw, they shouted, and fell on their faces. Leviticus 9:24
In this case, portions of sacrificial flesh still upon the Altar-hearth were suddenly consumed by Divine fire—a sign that the sacrifice and what it denoted found favor in the sight of God; cf. 1 Kings 18: 38.
(Hertz, Dr. J.H., The Pentateuch and Haftorahs, 2nd Ed., Soncino Press, London, 1992, pg 445)
Such "fire from before the Lord" was preserved and used as "divine fire" to light the Menorah and later offerings in the Temple.