After the Flood, God made an everlasting covenant with Noah, his family, their descendants, and all the living creatures. He promised never again to destroy the earth by a flood. The rainbow was the sign of that promise – a reminder of God's commitment to the earth. This is in the bible too.