Both Cain and Hagar do something wrong. Both get a chance to correct their attitudes and change the course of their steps. The Lord basically says, "You can do better!"
Cain has no regard for the correction of the Lord and INCREASES his "spiritual distance" from God. Hagar is our wonderful example as she hears the rebuke of God and changes direction beautifully. "You are a God of seeing. Truly here I have seen Him who looks after me." Hagar wins the cage match of example!
https://www.youtube.com/channel/UCNijvDWAn2Wv2KFun2AnvCA