Gygax and Arneson give only one direct clue in the original D&D rule books about the meaning of spell levels (which are distinct from levels of experience).
The number above each column is the spell level (complexity, a somewhat subjective determination on the part of your authors).
Their notion, then, is that the higher the spell level, the more complex it was. Therefore, I infer, a more experienced wizard is needed to understand the more advanced spells.
Gygax and Arneson admit that they have made a subjective judgment. They simply decided which spells were more complex than others. What is clear, though, is that the levels correspond with power.
There were six levels of magic-user spells and five levels of cleric spells. (Clerics acquire spells starting in the 2nd level.) The tables for “spells per day” reach the maximum with magic-users having 5 spells of each level per day and clerics having 3 spells of each level per day.
In Chainmail, the wargame antecedent to D&D, wizards’ most basic artillery spells were the Fireball and the Lightning Bolt. In D&D, these are third level spells, available to magic-user at fifth level. It seems that this level of power was imagined as a median. “Weaker” spells were put at lower levels and more powerful ones at higher levels.
I suspect that Gygax and Arneson started with those two spells and a few others that they devised (like the Death Spell, Reincarnation, and Disintegrate, set automatically at the highest level because these were the most powerful spells they would countenance), and built out from that framework. They’d come up with spell ideas, set some parameters for them, and fit them into that rough set of guidelines for levels.
Probably others could point out spells that were reassigned from one level to another between D&D editions as they turned out to be too powerful, or not powerful enough, for the level to which they had been assigned so far.
In short: the logic to assigning spell levels is relative to other spells, associative, and, as they said, “subjective.”