Read it through the lens of Proverbs 2, along with the perspective that throughout the entire Bible:
1) Every story unveils attributes/characteristics of God and/or foreshadows the coming Messiah (Yeshua/Jesus)
2) God is working to unveil His plan for redemption & relationship with us
3) Even when it doesn’t seem like it, God does everything because of His love (including justice)