The Lord had told them to bring a lamb for an offering, because it would cause them to think of Christ, for He was "the Lamb of God" who was to die for the sins of the world.
Before Jesus came to die, men showed their faith in Him by bringing a lamb for their sins. God accepted the offerings of all who were sorry for their sins, and forgave them. This was the Gospel in the Old Testament. Christ was the "Lamb slain from the beginning of the world," because, before the world began the plan was laid that He should die for man if he sinned.
Abel had faith in God. His heart was filled with love because a way had been made by which sinners could return to God, receive pardon, and finally be taken to a new Eden home.
Abel brought a lamb from his flock, and offered it to God for his sins. Looking at the lamb of his sacrifice he saw Christ, the dying Lamb, on the mountain of Calvary. His faith was "counted to him for righteousness," meaning that God called him good. His sins were forgiven. God was pleased with the offering brought by Abel, and so He sent down fire from heaven and burned up the sacrifice; but not so with Cain's fruit.
Then the heart of Cain was like the heart of Satan,—filled with hatred and rebellion against God. He could see the beautiful Garden of Eden which had been the home of his parents, but he could not enter it. An angel with a flaming sword guarded the gateway.
In his heart he charged God with cruelty in shutting them out of the garden, and dooming mankind to a life of labor and sorrow. He did not accept with gratitude the wonderful sacrifice made by the Son of God to redeem the world.