Covenants are a major element of the Biblical story. To understand what God is doing in the Biblical narrative we have to understand why he makes covenants with his people. The rainbow is explicitly tied to the covenant the Lord makes with Noah in Genesis 9. There, God sets the rainbow as a sign, a marker, a reminder of his promise. So, when we see a rainbow we need to stop and remember God's persevering love.