The flood story in Tablet XI was not composed for Gilgamesh; it was imported into the epic from older Mesopotamian tradition. As the scholar Andrew George shows in his critical edition, the Babylonian Gilgamesh incorporated a version of a flood legend already told in the earlier Akkadian poem of Atra-hasis, where the flood is the climax of a story about the gods reducing an overpopulous and noisy humankind, and the flood-hero bears that name.
Behind these Akkadian poems stands a still older Sumerian flood account, in which the pious king Ziusudra is the survivor. The names differ, Ziusudra, Atra-hasis, Uta-napishti, but the pattern is shared: a divine decision to destroy humanity, a warning to one favoured man, a great vessel, survival, and a sacrifice. The compiler of the Standard Babylonian epic drew this material in to serve Gilgamesh's search for immortality, so that the flood, once a story in its own right, became the proof that eternal life was a unique and unrepeatable gift.