the first rainbow appeared after the wideflood during Noah's time. God said that wideflood will not happen again. As a sign of that promise, God made the first rainbow.
Everytime Rainbow appears, this reminds the promise of God.
I screenshot the part of the bible verses where it wrote. π Genesis 9:11-16
This may explain further what i'm trying to say π