I'm also a little vague on exactly how martials are meant to be underpowered. Like, is it because they don't do as much damage? Is it because they can't teleport and fly and grant wishes? And is it a problem at 1st level or is it just a problem at like 15th? Is it because they don't have as many options? Everyone's got a different problem they want addressed.
In my experience, it comes down to two things:
1- "Martial" classes (ie, ones that are intended to solve problems with more mundane means, like Attack Actions and skill checks) can encounter situations where neither of these is sufficient to the task.
Look, I know that someone is going to tear apart any examples I make, or say something like "skilled play", or "Improvise Action", or "just house rule it", because I've been in
a lot of these discussions, but here's a few:
*NPC caster flies away/teleports/goes ethereal to escape. The Martial can't even track them, they're just, gone, man.
*You come upon a door that has been magically sealed, say, with Arcane Lock. You simply cannot hit the DC's required to open or break the door down.
*You're fighting a creature resistant to (or even immune to) normal weapons, but is vulnerable to cold damage.
*Your enemies decide to ambush you. Pass Without Trace makes the DC to detect them almost (or maybe even) impossible.
*You want to ambush your enemies. Oops, turns out they had an Alarm spell going. Or are resting inside a Tiny Hut.
*You get into a fight with a Medusa. One of your allies is turned into a stone statue. Unless the DM adds it to the game, the default answer to this is....magic!
*In a crucial fight, you get trapped inside a Wall of Force and must watch helplessly as your allies fight.
2- The adventuring "day" is too short to compete with "I Win" buttons spellcasters have access to. Most games I've been in, people think "adventuring day" means "in-game day", because that's logical and makes sense to them. You sleep 6-8 hours every day, surely that's a Long Rest, right? But when you run the game that way, you're not always going to have a bunch of encounters. Traveling from point A to point B, you might encounter some wandering monster on Day 2 of 4. Or bandits. Or anything, really. Even if the DM tunes the encounter up, knowing it's likely going to be the only one the players face, when the casters can just toss out their most effective spells, some of whom can just trivialize the encounter, non-casters can feel completely overshadowed.
Now D&D is a team game, and it's intended to give everyone equal "spotlight" time. But there are things non-casters cannot do, and very few things casters can't do. It's great if you're really good at making skill checks, or attacking eight times a turn, but there are scenarios those things can't solve.
And yeah, sure, there are things magic has a hard time with, like Magic/Legendary Resistance, or DM's deciding to toss "antimagic fields" everywhere, lol, but in a lot of games, it can seem like the game is designed for the answer to a lot of problems is "magic man".