Also, “martial” in this case specifically refers to Fighters, Barbarians, and Rogues.
Don't discount Monks! They're generally regarded as the worst class in the game, as they're essentially fighters that deal less damage in exchange for a resource that lets them use cool abilities...for a short time. Yeah, I know they're technically? magical, but they function and present as a martial class, poorly at that.
The disparity is choice and impact. Because of their lack of choices, it can seem difficult to have an impact on the game, mechanically. A good DM can make up for this in a variety of ways, but when you’re just looking at the rules or white-rooming a character, the problem does tend to become a bit obvious…if overblown.
Also don't discount, being able to play out-of-combat scenarios. Casters get utility like Pass Without Trace, Spider Climb, Prestidigitation, Friends, and then the fact that most of them are charisma-based for some strange reason, which is THE out-of-combat stat. I know my suggestion in particular doesn't really address that, and is more focused on the more-abilities and/or allowing interesting choices part that you mention after that, but I do absolutely want things like 3.5e's Moment of Perfect Mind, and whatnot.
When power levels of the degree of modern TTRPGs are expected of characters, D&D sort of becomes a game all about your options and which you choose when. If certain characters have inherently MORE options to pick from in such a setting, that means they are essentially objectively better by default.