Western ElementsThe four classical Western elements — Fire, Earth, Air and Water — came about from Greek philosopher Aristotle and his attempts to figure out the basic "building blocks" of the universe (interestingly enough, the first venture into atomic theory was made at the same time Aristotle started to popularize his elements theory, but Aristotle being more popular with the public, his model ultimately prevailed, while atomic model was dismissed as implausible). According to elemental model, everything "under the moon" is made of one or more of aforementioned four elements — for example, coal was Earth+Fire, while a human, animal or plant was Air+Fire+Earth+Water. The difference between various things comes from proportions in which those four elements were within them — for example, the heavier the metal, the more Earth it has compared to other elements.
By Aristotle's model, then, an elemental magic user should be capable of using everything that contained their element, so Water wizard could also control plants, and Fire wizard would be capable of controlling most metals. This, of course, would produce some Story Breaker Powers, hence why in media, it's usually watered down into "pure" Earth, Fire etc. (this, plus Aristotles' view on building blocks of the universe isn't exactly most common knowledge). Excluding elements such as Wood or Metal, which hail from Eastern philosophy, many "extra" elements, like Lightning, Ice and Sunnote , come from writers "filling in" holes in the system that weren't present in the original model, as Aristotle intended for his elements theory to explain the nature of literally everything.
For the record, Aristotle wasn't the first one to think of the four-elements model — he was only the one to systematize and popularize it the most, and it's his take on it that shapes the current Elemental-style magic the most.
The elements were also arranged in a system of "tiers", which could relate both to purity and position and was often used to explain how the universe at large was structured: essentially, the assumption was that the elements were naturally arranged in spheres around each other, and that it was in their natures to seek to move above lower elements and sink below higher ones — so, heavy and dense Earth sought the center, then came Water to form seas and lakes over Earth, then Air, then Fire to form the stars and Sun.
Interstingly enough, Element Number Five is Older Than They Think, predating even Aristotle — though again, it was him who gave it the most recognizable form. The Aether, as it was called, was a weightless, colourless substance that formed the "celestial spheres" and caused moon, planets and stars to move. It was something of a departure from earlier descriptions — in Homer's times, Aether was considered to be "purer air", being what gods at Mount Olympus breathed (which suggests that gods need to breathe, which of course begs the question of how Poseidon can be the king of the seas), and generally, it was thought to be simply air that was higher than "regular" air humans breathed, filling interstellar space.
If you are interested in going further down the rabbit hole of symbolism, in Greek medicine every element had its associated humour and bodily fluid from the Four-Temperament Ensemble. Air was blood, as both were hot and wet, and the Sanguine temperament; cold and dry Earth was associated with black bile and thus Melancholia; Fire, being hot and dry, was element of yellow bile and Choleric Temperament, while cold and wet Water was associated with phlegm and Phlegmatic humour.