NPC Classes are used for NPCs that don't play a major role in the story
The idea behind NPC classes are that they are not as powerful as PCs, and that they should be used for minor characters in the story. For example, in Pathfinder, the Adept class will be what most "priests" in a given church would be. They have some minor powers, and can cure wounds, but if you really need healing you'll need to go find an actual Cleric, which may be really hard to find in a small town.
Likewise, most city guards won't have PC levels, they'll have NPC warrior levels.
Most "normal" people will be Level 1 commoners.
You would not use NPC classes for a major villain
Major movers and shakers will have PC levels. If you are making a powerful adversary, NPC classes are not the way to go. If you've got Pathfinder, have a look at the creating NPCs section, and you'll see near the back there is an example of how to give an NPC regular Class levels. (Note that they still tend to have lower stats unless you choose to give them better ones).
Sources:
- Basic Rules (BR), Chapter 3: Classes
- System Reference Document (SRD), p. 8-55
- (Note: D&D Beyond's "Basic Rules" listing is actually an
inclusive combination of the Basic Rules PDF and the SRD)
- Player's Handbook (PHB), Chapter 3: Classes
- Sword Coast Adventurer's Guide (SCAG), Chapter 4: Classes
- Xanathar's Guide to Everything (XGtE), Chapter 1: Character Options
- Tasha's Cauldron of Everything (TCoE), Chapter 1: Character Options
- Van Richten’s Guide to Ravenloft (VRGtR), Chapter 1: Character Creation
- Fizban's Treasury of Dragons (FToD), Chapter 1: Character Creation
- Guildmasters' Guide to Ravnica (GGtR), p. 25-27
- Mythic Odysseys of Theros (MOoT), Chapter 1 > Subclass options
- Wayfinder's Guide to Eberron (WGtE), Appendix D
- Eberron: Rising from the Last War (E:RftLW), p. 54-63
- Explorer's Guide to Wildemount (EGtW), p. 182-186
- Dungeon Master's Guide (DMG), p. 96-97
Artificer (WGtE, E:RftLW, TCoE)
Artificer Specialists:
- Alchemist (WGtE, E:RftLW, TCoE)
- Armorer (TCoE)
- Artillerist (E:RftLW, TCoE)
- Battle Smith (E:RftLW, TCoE)
Barbarian (SRD, PHB)
Primal Paths:
- Path of the Berserker (SRD, PHB)
- Path of the Totem Warrior (PHB, SCAG)
- Path of the Battlerager (SCAG)
- Path of the Ancestral Guardian (XGtE)
- Path of the Storm Herald (XGtE)
- Path of the Zealot (XGtE)
- Path of the Beast (TCoE)
- Path of Wild Magic (TCoE)
Bard (SRD, PHB)
Bard Colleges:
- College of Lore (SRD, PHB)
- College of Valor (PHB)
- College of Glamour (XGtE)
- College of Swords (XGtE)
- College of Whispers (XGtE)
- College of Eloquence (MOoT, TCoE)
- College of Creation (TCoE)
- College of Spirits (VRGtR)
Cleric (BR, SRD, PHB)
Cleric Domains:
- Knowledge Domain (PHB)
- Life Domain (BR, SRD, PHB)
- Light Domain (PHB)
- Nature Domain (PHB)
- Tempest Domain (PHB)
- Trickery Domain (PHB)
- War Domain (PHB)
- Arcana Domain (SCAG)
- Forge Domain (XGtE)
- Grave Domain (XGtE)
- Order Domain (GGtR, TCoE)
- Peace Domain (TCoE)
- Twilight Domain (TCoE)
- Death Domain (DMG)1
Druid (SRD, PHB)
Druid Circles:
- Circle of the Land (SRD, PHB)
- Circle of the Moon (PHB)
- Circle of Dreams (XGtE)
- Circle of the Shepherd (XGtE)
- Circle of Spores (GGtR, TCoE)
- Circle of Stars (TCoE)
- Circle of Wildfire (TCoE)
Fighter (BR, SRD, PHB)
Fighter Archetypes:
- Champion (BR, SRD, PHB)
- Battle Master (PHB)
- Eldritch Knight (PHB)
- Purple Dragon Knight (SCAG)
- Arcane Archer (XGtE)
- Cavalier (XGtE)
- Samurai (XGtE)
- Echo Knight (EGtW)
- Psi Warrior (TCoE)
- Rune Knight (TCoE)
Monk (SRD, PHB)
Monastic Traditions:
- Way of the Open Hand (SRD, PHB)
- Way of Shadow (PHB)
- Way of the Four Elements (PHB)
- Way of the Long Death (SCAG)
- Way of the Sun Soul (SCAG, XGtE)
- Way of the Drunken Master (XGtE)
- Way of the Kensei (XGtE)
- Way of Mercy (TCoE)
- Way of the Astral Self (TCoE)
- Way of the Ascendant Dragon (FToD)
Paladin (SRD, PHB)
Sacred Oaths:
- Oath of Devotion (SRD, PHB)
- Oath of the Ancients (PHB)
- Oath of Vengeance (PHB)
- Oath of the Crown (SCAG)
- Oath of Conquest (XGtE)
- Oath of Redemption (XGtE)
- Oath of Glory (MOoT, TCoE)
- Oath of the Watchers (TCoE)
- Oathbreaker (DMG)1
Ranger (SRD, PHB)
Ranger Archetypes:
- Hunter (SRD, PHB)
- Beast Master (PHB)
- Gloom Stalker (XGtE)
- Horizon Walker (XGtE)
- Monster Slayer (XGtE)
- Fey Wanderer (TCoE)
- Swarmkeeper (TCoE)
- Drakewarden (FToD)
Rogue (BR, SRD, PHB)
Roguish Archetypes:
- Assassin (PHB)
- Thief (BR, SRD, PHB)
- Arcane Trickster (PHB)
- Mastermind (SCAG, XGtE)
- Swashbuckler (SCAG, XGtE)
- Inquisitive (XGtE)
- Scout (XGtE)
- Phantom (TCoE)
- Soulknife (TCoE)
Sorcerer (SRD, PHB)
Sorcerous Origins:
- Draconic Bloodline (SRD, PHB)
- Wild Magic (PHB)
- Storm Sorcerer (SCAG, XGtE)
- Divine Soul (XGtE)
- Shadow Magic (XGtE)
- Aberrant Mind (TCoE)
- Clockwork Soul (TCoE)
Warlock (SRD, PHB)
Otherworldly Patrons:
- The Archfey (PHB)
- The Fiend (SRD, PHB)
- The Great Old One (PHB)
- The Undying (SCAG)
- The Celestial (XGtE)
- The Hexblade (XGtE)
- The Fathomless (TCoE)
- The Genie (TCoE)
- The Undead (VRGtR)
Wizard (BR, SRD, PHB)
Arcane Traditions:
- School of Abjuration (PHB)
- School of Conjuration (PHB)
- School of Divination (PHB)
- School of Enchantment (PHB)
- School of Evocation (BR, SRD, PHB)
- School of Illusion (PHB)
- School of Necromancy (PHB)
- School of Transmutation (PHB)
- Bladesinging (SCAG, TCoE)
- War Magic (XGtE)
- Chronurgy Magic (EGtW)
- Graviturgy Magic (EGtW)
- Order of Scribes (TCoE)
D&D Beyond has a nicely formatted reference for all of the available classes/races/etc. Subclass and subrace information is also available by looking at the parent class or race's details. It should be noted that the free access materials do not include much outside of the D&D Basic Rules. They do offer other books' content, but that content must be purchased separately.
D&D Beyond
Classes Page
Races Page
1 These subclasses are included in the DMG and can be used only with the consent of the DM because they are generally made to be used for NPCs only or only in special DM-granted circumstances. However, the DM may choose to make these subclass options more generally available.
Best Answer
Within the rules and various race, class, and feature descriptions, "martial" seems to generally refer to non-magical combat techniques.
After reviewing the ways the rules texts use the word "martial", I have come to the conclusion that it loosely refers to non-magical combat techniques. We often see the word "martial" used as an antithesis to "arcane" or "magical". For example, in the Fighter class description:
And more specifically, in the Eldritch Knight martial archetype description:
Similarly, in the Hobgoblin race description, we see:
In the Rune Knight martial archetype description, we see:
In the elf race description, we see:
And in the Paladin class description:
And in the lore description of the Echo Knight martial archetype:
So the general view of the rules seems clear: "martial" combat techniques are those combat techniques that are not "arcane" or "magical" combat techniques. But this is where the clarity ends.
There is no official classification in the rules that identifies certain classes as "martial" classes.
The rules seem clear enough to be able to distinguish between martial and arcane techniques, but there is no attempt in the rules text to neatly categorize classes and subclasses this way. Some class and subclass combinations consist entirely of martial techniques, some consist entirely of arcane techniques, and many consist of a combination of both. In my experience, everyone agrees that wizards are not a martial class, and that the battlemaster fighter is a martial class, but there is little agreement on the in-between class and subclass combinations, because this sort of classification is just not something the rules are concerned with.
A possibly helpful categorization I am familiar with is "Full-Half-Third-Martial".
I have often seen the classes and subclasses divided up based on the nature of their spellcasting feature. They are divided into "full casters", "half casters", "third casters", and "martials". The Martial classes in this context would be all those class and subclass combinations which lack a Spellcasting class feature. The rest of the classes are categorized according to the rules used in calculating your spell slots as a multiclassed character:
In this context, classes and subclasses are categorized based on the number of spell slots they contribute, with Bards, Clerics, Druids, Sorcerers, and Wizards contributing the full array of spell slots, Paladins and Rangers contributing approximately half that of a full caster, and Eldritch Knights and Arcane Tricksters having approximately one third the available slots of a so called full caster.
This categorization seems pretty consistent with my play experience. I've played class/subclasses in each of these categories, and in my experience, the full/half/third designations feel appropriate based on how much I use their spellcasting features. Obviously, playing a Sorcerer is going to mostly consist of using the spellcasting feature, as the main class and subclass features serve to augment your spells. Playing a paladin has always felt, to me, like a fifty-fifty split between being a cleric and a fighter, and playing an Arcane Trickster has had me primarily relying on my mundane roguish features, with the occasional boon from my spellcasting. And of course, my champion fighter made no use of spellcasting. Obviously, your mileage may vary with the half and third casters, depending on the build you use.
To be clear, these categories are derived from a particular mechanic in the rules, but this categorization is not part of what the rules are trying to do. This section of the rules happens to give a convenient and accessible framework for categorizing these classes that seems to work out consistently in play, but this is definitely not "the rules say these are the four categories of classes".
This answer from Xirema gives a more in depth look at the difference between these categories of spellcasters.