Would love to hear more about this difference and/or your experience!
What does PF2e do differently so that this disparity is less of a thing ?
One side of it is (IMO) more security within the single target damage niche. From what I've experienced so far, spells are powered down quite a bit especially as far as damage relative to what the fighter's, barbarians, and rogues are bringing to the table. And the casters that I've seen are waaay squishier getting fewer relative hit points per level and little way to get good armor proficiencies which makes them much easier to take down.
Another side of it is feats and the actions they support in combat. 5e has grappling rules, but almost nothing in the system refers to or makes use of them. And a martial character with a high mental stat will almost always have to go outside of their class to find tools that allow them to benefit from it.
In 2e, there are a ton of feats that encourage you to engage with crafting, intimidation, grappling/tripping/shoving, etc. and there are distinct benefits for doing so. You're almost never in a situation where all you've done on your turn is attack, and the non-attack actions rarely feel wasted.
In addition, martial feats largely continue to scale in power. With certain feat choices Barbarians can become dragons or giants, fighters can cut through the fabric of space, rogues can phase through walls, rangers can hunt things across planes.
I can't testify to how effective these things feel relative to spells at the equivalent levels, since I haven't gotten there yet, but the options alone help reinforce that these characters are heroic, not just dudes at the gym.