It can't be in-world archetpes, concepts like Fighter and Mage are waaaay too broad for that. Is it HD?
IMO mechanics are only a minor part of that. Sure Rage is part of the Barbarian class, Ki is part of the Monk class, and spellcasting classes have their rules (albeit the same for all of them), but it's not the most important thing (and there might be multiclassing feats or other classes' subclasses granting similar mechanics).
It's really just archetypes at the end. People want to play a Wizard or a Barbarian or a Druid, although each has different expectations, a lot of them coming from fiction (books, movies, PC games...). Some classes might be going after a wider archetype, but the presence of narrow-archetype classes in the same game can manage to narrow e.g. the Fighter's archetype, in the sense that if you have a Paladin class then it tends to "absorb" the holy warrior concept, even tho nobody's forced to choose Paladin over Fighter.
My bottom line is, that while we D&D-nerds are here splitting hair over what is a Fighter

there are probably a lot of both casual and serious players who don't care about academic reasoning, and just
know what a Fighter is in their mind, they pick up the Fighter class, and make it
work as a whole, while we're thinking too much about why this detail here and there doesn't perfectly fit.
Agreed. They've offloaded so much on subclasses that the classes are just... well, weird. Some of them are hollowed-out husks, while others still have their own mechanics.
I think that's only the case of the Mage class, which is almost empty if Wizardry is a selectable feature. But it's not the case for all other classes, the features from class are still more than the features from subclass. Even if you take classes where the subclass is huge e.g. 7-8 features, you still get at least as many level-based features from the class directly.