God said the rainbow is a sign of His promise. Previous to the flood, the earth never saw rain, although a thick dew fell nightly to water the earth.
But because of sexual sin, and violence, God decided to wipe all all mankind (except Noah’s family). He sent the flood as a “baptism” to kill every creature with breath. God promised that He would never destroy all mankind again with water. He gave the rainbow to be a sign that He will never destroy all mankind with water again. The key phrase here is “with water”.
The Rainbow is Here to Remind us of God’s Wrath Past, and Future
Scientific Point of View
The rainbow could have been displayed in the sky prior to the flood, under the right conditions. Previous to the flood there is no record of it ever raining on the earth as we know rain today.
Rather, the Holy Scriptures tell us that there was a heavy dew that fell and watered the ground. And under normal circumstances, a heavy dew does not produce a rainbow.
The Rainbow to FIRE
God gave the rainbow as a sign that He would not destroy the earth with water again. BUT it does not say that God would never destroy the earth again.
The Apostle Peter, one of the closest disciples to Jesus clearly states in his second epistle that JUST as God destroyed the earth with water in the past, He WILL destroy the earth with FIRE – citing Sodom and Gomorrah as examples.