This is mostly true, but there are spellcasters who can compete on the same tier as the warriors, especially if they are willing to sully themselves with a splash of warrior class.

For instance, a Fighter 2/Evoker 10 can output 119 points of
guaranteed force damage once per long rest[1] (Magic Missile V + Action Surge), while rocking Constitution save proficiency, AC 26, and a slew of conjured mephits, animated undead, or animated objects for meat shields. The damage guarantee is important; an action-surging 12th-level Polearm Master GWM fighter may be theoretically capable of inflicting 158.25 DPR against an AC 0 foe (including both bonus action and reaction attack for a total of 8 attacks), but in reality, even against a low-AC tyrannosaur he does only 100.60 even if his bonus and reaction attacks trigger. (With advantage against the tyrranosaur he does beat the Evoker 142.05 to 119.) Against an AC 20 Iron Golem however, the tables are turned: the action surging fighter loses 43.20 to 119, or if he has advantage he merely loses 76.04 to 119. Even if the Evoker doesn't nova, he can blow a third-level spell slot for 42.5 damage, virtually matching the fighter's Action Surge.
(Once upon a time, Iron Golems were immune to Magic Missiles and almost all other spells. No more, in 5E. Le sigh.)
[1] Once per short rest if spell points are in use. Otherwise, on the second short rest he is reduced to Magic Missile V + Action Surged Magic Magic IV for only 110 points of damage (thanks to Arcane Recovery), and then Magic Missile IV x2 for 102.5 on the third short rest.