The short answer is that the theme of the "rainbow" comes from Near Eastern mythology.
The Hebrew word qesheth used in Genesis 9:13-15 is actually the word for "bow" as in archery, there is no separate word for "rainbow" in Hebrew. The only other occurrence of qesheth in the sense of "rainbow" is in Ezekiel 1:28 -- all other uses of the word in the OT refer to a physical bow (cf. Genesis 27:3, 48:22, 49:24; Joshua 24:12; 1 Samuel 2:4, 18:4; 2 Samuel 1:22, 22:35; 1 Kings 22:34; 2 Kings 6:22, 9:24, 13:15-16; 1 Chronicles 5:18, 8:40, 12:2, etc. etc.).
The concept of Yahweh's bow derives from Canaanite mythology -- the storm god Baal was identified with Yahweh in early Israelite religion, so that many of the epithets and motifs of Baal which are known from Canaanite myths were later applied to Yahweh. This is especially the case with meterological language. Yahweh is most clearly described as the source of rain and storm in 1 Samuel 12:18, Psalm 29, 77:16-18, Job 28:25-38, Jeremiah 3:3, 5:24, 10:13, 51:16, Amos 4:6-7, Haggai 1:7-11, and Zechariah 10:1. In Canaanite texts, Baal rides a winged war chariot (cf. 2 Kings 2:11, 6:17; Psalm 18, 65:12), riding against his enemies with his divine horses (cf. Habakkuk 3:8, 15), both Baal and Yahweh are given the epithet rkb 'rpt "Cloud Rider" (Deuteronomy 33:26; Psalm 68:4, 104:3; cf. Psalm 18:9-14 and 68:33, "Rider of the Heavens"), both are descibed as a bull or calf or with bovine imagery ("the bull of Jacob" in Genesis 49:24; Psalm 132:2, 4 and "the bull of Joseph" in Deuteronomy 33:17), both battle against the seven-headed Chaos sea monster variously named Lotan/Leviathan, Yam, Rahab, "the fleeing serpent" (Job 3:8, 26:21-13, Psalm 65:7, 74:13-14; 89:10, 104:26; Isaiah 11:15, 27:1, 51:9; cf. also Revelation 12:7-9, 15, 17:3, 21:1; 4 Ezra 6:49-52, Testament of Moses 10:6; Odes of Solomon 22:5), both fight against the Sea with Resheph in their entourage (Habakkuk 3:5-8), both have a divine mountainous abode (Exodus 15:13; Psalm 46:5, 87:1; Joel 4:17), the holy mountain in both cases is called Zaphon (Psalm 48:2-3; Isaiah 14:13; cf. Psalm 20:2 in the Aramaic version and Psalm 27:4-5 which puns on the name Zaphon in the Hebrew).
Most significantly, in both cases thunder is described as their voice (Exodus 19:19; 2 Samuel 22:14; Job 37:4, 40:9; Psalm 29:3-9, 68:33; Isaiah 30:30) and lightning is described as their arrows (2 Samuel 22:15; Psalm 18:14; Psalm 144:6; Habakkuk 3:11; Zechariah 9:14). Examples from the OT:
"He shot arrows and scattered the enemies, bolts of lightning and routed them." (2 Samuel 22:15)
"Yahweh thundered from heaven, the Most High made his voice heard; he let his arrows fly and scattered them, launched the lightnings and routed them." (Psalm 18:13-14)
"The voice of Yahweh shatters the cedars, Yahweh shatters the cedars of Lebanon, making Lebanon leap like a calf, Sirion like a young bull. The voice of Yahweh sharpens lightning shafts....The voice of Yahweh sets the terebinths shuddering, stripping the forests bare. The God of glory thunders." (Psalm 29:5-9)
"Yahweh will appear above them and his arrow will flash out as lightning. The Lord Yahweh will sound the trumpet and advance in the storms of the south." (Zechariah 9:14)
Similarly, in the Baal epic, Baal's chief weapons are lightning bolts and thunder is his voice: "Now is the season of his rains may Baal indeed appoint, the season of his storm-chariot. And the sound of his voice from the clouds, his hurling to earth of lightning flashes" (KTU 1.4 v 6-9), "Baal opened a rift in the clouds; his holy voice Baal gave forth; Baal repeated the issue of his lips. At his holy voice the earth quaked," (KTU 1.4 vii 25-35), "Seven lightning-flashes and eight bundles of thunder, a cedar of lightning in his right hand" (KTU 1.101 R 1-5), etc. In the Baal epic, the craftsman god Kothar fashions him the lightning-weapon (zmd) that Baal uses to kill his foe Lotan/Yam; while not a bow, it is a weapon that utilizes Baal's power over lightning. This forms a parallel with Zeus' thunderbolts as fashioned by Cyclopes, the son of the craftsman-god Hephaistos. Another parallel may be found in the Rig Veda, which tells of Indra defeating Virtra with thunderbolt arrows forged by the divine craftsman Tvashtr. The name of Baal's weapon, zmd or Zamad, can be found in Phoenician inscriptions which refer to "Baal of the zmd," and a late vestigal survival of this epithet can be found in an obscure epithet of Allah in the Quran: allahu s-samadu "Allah is Al-Samad" (Surah 112). In Ugarit legend, the craftsman god Kothar also fashions a divine bow for Aqhat, the son of the mighty and wise king Danel and the war goddess Anat becomes jealous and wants the bow for herself and she ends up killing Danel's heir. This story was also well-known to the Israelites and Ezekiel alludes to it (or a later Israelite version of it) several times.
In this context, when the rains of a storm have ended, the storm god hangs up his bow in the heavens to show that it is no longer being used and the rains have stopped. This is the notion in Islam, where the rainbow is called qaws-e-quzah, the Bow of Quzah. In ancient Arab folklore, the rain god Quzah shoots arrows from his bow and then hangs it up in the clouds. As Islam developed, the old pagan gods were turned into demons under monotheism (quite similar to what happened in post-exile Judaism), and Quzah became a demon -- which promoted a change in the name of "rainbow" to the Bow of Shaitan (an angel) or qawsuallah, the Bow of Allah. Another parallel can be found in the Babylonian creation epic Enuma Elish, where Marduk's bow, which had been used against Tiamat (the Babylonian equivalent of Lotan/Yam), was set in the heavens as a constellation. In the Rig Veda, the battle-bow of Indra, after his contest with the demons, was laid aside in the clouds as a rainbow. In the Rainbow Covenent in Genesis 9, Yahweh says: "I set my bow in the clouds and it shall be a sign of the Covenant between me and the earth. When I gather the clouds over the earth and the bow appears in the clouds, I will recall the Covenant between myself and you" (9:12-15). The concept is that the bow Yahweh used to open the floodgates of heaven is lodged once and for all in the clouds, and will remind Yahweh every time he makes it rain to never use it again to flood the earth.
And incidentally, the Flood is conceived in the narrative as a universal flood since text claims that "Yahweh destroyed every living thing on the face of the earth" (Genesis 7:23) and Genesis 10 presents all the nations of the world as the descendents of Noah's children. There is of course no concept of a global Flood however since the ancient Israelites had no idea the world was so large. Even the local Flood of the Sumerian and Babylonian tales is presented as a universal Flood, as if the entire world was the land of Sumer. And presumably there were no rainbows before the Flood because Genesis 2:2-6 states that "Yahweh God had not sent rain on the earth" and the earth was watered not from above by from water "rising from the earth and watering all the surface of the soil."
Leolaia