Eh, it depends. Look at level 5. The Fighter gets their extra attack. Without taking GWM into account (which is when you'd want Bless or advantage-granting), you have 2 attacks at 2d6+4 and +7 to hit. You can action surge to get another 2d6+4. Now that's 11 damage per hit.
A Wizard's Fireball (which is a generously large area of effect) can probably catch 3 enemies in the blast. Your 8d6 is going to do 28 damage on average (save for 14).
There's a lot of intangibles here, but if the FIghter's 33 damage can kill one thing, the Fireball's damage should get pretty close to killing one thing, and maybe multiple things. And at the very least, the Fireball lets the Fighter kills more than one thing on their turn by attacking multiple toasted foes- in this scenario, the Wizard really did 84 damage on their turn.
But! The Wizard can only do that a few times per day, and the Fighter will have many rounds of potential 22 damage (or more) with the occasional 33 damage round. And that's not even taking into account if the Fighter is a Battlemaster, giving them some extra dice to toss around.
As for optimization, well, it doesn't matter what your optimization level is with the Wizard, Fireball is Fireball. Where the weapon choice, exact Strength, and presence/absence of Feats can vary wildly.
So what happens is, Fireball does an insane amount of damage, that really should be tracked by all the damage it deals to all targets, since it makes them that much easier to kill. But Fireball is a limited resource that has to be set up carefully (unless you're an Evocation Wizard).
So over the course of the day, the Fighter will likely deal more damage (one would hope) and some combats, the Wizard will trivialize an encounter.
Where things get really wacky is when you start looking at area damage effects that can last multiple turns, like, say, the Cleric's Spirit Guardians.