The idea that the world is composed of four or five elements (fire, water, earth, wind, and aether) was almost universal in the ancient world. The science and mythology of many ancient civilizations, from Greece to Japan, operated on this understanding.
While Islam is not really married to the idea of four elements (it is not supported in an explicit way in the Quran or hadiths), it is interesting to note that Islamic metaphysics and cosmology use this system.
This is especially the case in the spiritual world. The jinn are made from a smokeless Fire, the humans are made from Earth (Teen), and the soul (ruH) comes from the word for Wind (reeH). The Throne of Allah was settled upon Water (11:7), until that water was separated into the heavens and earth. The angels are from light (Noor, a word related to Nar).
Allah does not raise a prophet except that he speaks the language of his people. He may have used these literary devices to explain a realm that is ultimately beyond our understanding (ghayb). The Quran is a book that needs to be intelligible to people, especially when speaking on the unseen and unknown.
While the universe is simply not made up of H2O, the image of Water as a fluid, clear, shapeless structure is befitting to understanding the world. In physics, the concept of fields (gravitational, spatial) operate largely on fluid mechanics. “Water” is a chaotic substance that was then categorized, compartmentalized and distinguished into the world we know today.
Similarly, a simple sample of the water (saliva) in your body can create an entire profile of who you are: your DNA, and therefore, your family lineage, your appearance, your susceptibility to diseases, and even parts of your personality.
There are some things that are beyond literal and metaphorical. The dichotomy of literal and metaphorical is sometimes not just inaccurate, but harmful to our readings of scripture.