The Cavalier, based on the long and romanticised history of the horse-riding, lance-wielding knight, is one of the bastard stepchildren classes of Dungeons & Dragons, something that almost everyone tries to sweep under the rug, yet which keeps popping back into the light no matter what is done by the fans (it's probably mostly due to that asshole Erik).
There are two specific breeds of Cavalier in the context of D&D. The original variety, known today as the Cavalier-Paladin, is a horror that only neckbeards of Old School Roleplaying lineage have experienced, and which has been more or less successfully stamped out, and the "proper" cavalier, who has manifested itself once per edition ever since.
The Cavalier-Paladin was an original creation of Gary Gygax himself, first appearing in Dragon Magazine #72, before appearing in the 1985 Unearthed Arcana splatbook and then a third time in Dragon #148. It was basically a super-Paladin, which is exactly why it earned so much hate; although it came with a bunch of powerful class traits, it combined the Paladin's already obnoxious mechanically-enforced Lawful Stupidity with an even more party-annoying obnoxious bit of "enforced fluff" - the actual need for the player to act like a Leeroy Jenkins, but constantly charging off to fight enemies, even when smarter approaches were required. Even the author of the revised version from Dragon #148 admitted that the Unearthed Arcana Cavalier was "overly complicated to play".
Needless to say, the Cavalier-Paladin made no friends in D&D audiences and it has mostly been consigned to the dustbin of history ever since.
The other version of the Cavalier has been around since Advanced Dungeons & Dragons. Essentially, it's a Fighter variant, revolving around increased skills at fighting from the back of the steed. From a kit in second edition (The Complete Fighter's Handbook, Player's Option: Skills and Powers) to Prestige classes in 3 (Sword & Fist) and 3.5 (Complete Warrior) to a Martial Archetype (class branch) for the 5e Fighter, it's fairly stable. Unlike the Cavalier-Paladin, though, it's not mechanically forced into being obnoxious... but it's still never really taken off.
Why? Because the Cavalier has always been a one-trick pony; good at fighting from steed-back. Put them in a situation where they can't ride their steed - like, say, crawling in your stereotypical dungeon - and they're basically a worthless half-fighter.
These aspersions actually have some solid grounding in reality. The term "Cavalier" was in common use during the 17th century as supporters of King Charles I of England, who is famous for losing the English Civil War and having his head lopped off by Parliament as a result. Cavaliers were named as such for their preference for fighting on horseback, which lent itself substantially to the feared reputation of the Royalist cavalry in the early stages of the civil war. However, they were prone to indiscipline and had a nasty habit of breaking up after the charge to go loot the baggage. This issue was not remedied in later stages of the war, which saw the Parliamentarian cavalry become their equals and the Royalists losing much of their battlefield advantage because of this indiscipline.
Pathfinder eventually took a shot at making a Cavalier class of its own, the first time it's been a full class since AD&D. Although probably more popular as serving as the foundation for the Pathfinder's Samurai class, it does manage to be more effective than Cavaliers have traditionally been - this is because it manages to be a two-trick pony, with a focus on teamwork through the use of challenges and features that bolster allies, which actually makes it pretty similar thematically to 4e's Warlord class.
Cavalier's big customization option is their choice of from a variety of "Knightly Orders," that give him additional benefits and customizability, but also require him to keep up a code of conduct. Unlike the paladin's code, though, not all of these "codes of conduct" are pure Lawful Good stuff, and many vary heavily from order to order. While these do have a code of conduct, not all of these "codes of conduct" are pure Lawful Good stuff, and many are pretty manageable, and the only penalty for violating it is losing one of their less important abilities for 24 hours and many are total non-issues. For example, an Order of the Cockatrice Cavalier is one of the more restrictive ones yet is basically automatic for any adventurer: They must work to advance themselves, never accept less than an equal share of the loot, must accept payment when it's given, and keep their interests above others, none of which is actually evil.
Cavalier's other class features are Challenge, a weaker smite without target restrictions, Tactician, which grants allies various Teamwork feats, and Banner, a small passive buff to allies who can see your banner. Unfortunately, Cavalier has no customization past first level aside from feat selection (including the one from Tactician). Theoretically it picks what stats increase its animal companion gets, but there’s no reason to choose anything but one point of intelligence and the rest to strength. Paizo also really, really hated the idea of them getting any mount more useful than a normal horse, so all options provided were extremely excessive costly and full of nonsense hoops. This was really bizarre since Ranger and Druid have been able to get a Roc since the Bestiary (Read: Core).
Curiously for a non-core class Cavalier has two of the more worthwhile non-core Prestige Classes devoted to them. The first, Battle Herald, focuses on the commander aspect by progressing the Bard's Inspire Courage alongside full BAB at the cost of mount progression, a cost which can be avoided a few ways or ignored entirely by trading it for something more useful. The second, Mammoth Rider, focuses on making the mount a giant, powerful engine of death. While this does exacerbate the problem of taking your mount anywhere that's not a wide open wilderness, it's a lot more powerful when it can bring their giant saber-tooth tiger along. One massive oversight of the class is its skill list contains no Knowledge skills, so they're not very good at recognizing nobility.
While Pathfinder's cavalier is the best version they've been, they still aren't great. While they have something to do if they can't bring their mount, it isn't all that powerful. Cavaliers are generally as low as Tier 5, though small cavaliers (who can bring their pony into dungeons but not in public buildings) and better archetypes that trade away the mount may get up to tier 4.
Cavalier was cut from the class list of Pathfinder Second Edition, being reduced to an archetype (archetypes here being essentially a chain of feats to take in place of class feats) during the 2018 playtest. And even then, it didn't appear in the CRB. It would only appear in the Advanced Player's Guide, alongside a bunch of other non-class archetypes.
This version of the cavalier gives you a riding mount off the bat, which not many classes can do (Druid and Ranger, while Champion has to wait a few levels) but requires proficiency in either Society or Nature. This feat tree includes the mandatory pet-progression feats that come with owning a pet, but it also has several ways of taking the sting off of owning a mount, like using your AC to protect the steed, mounting on and moving in a single action and being able to move twice while also attacking. It even provides that token banner feature the class had, adding that token +1 to Will.
|The Classes of Pathfinder 1st Edition|
|Core Classes:||Barbarian - Bard - Cleric - Druid - Fighter - Monk |
Paladin - Ranger - Rogue - Sorcerer - Wizard
|Alchemist - Antipaladin - Cavalier |
Inquisitor - Oracle - Summoner - Witch
|Arcanist - Bloodrager - Brawler - Hunter - Investigator |
Shaman - Skald - Slayer - Swashbuckler - Warpriest
|Kineticist - Medium - Mesmerist |
Occultist - Psychic - Spiritualist
|Ultimate X:||Gunslinger - Magus - Ninja - Samurai - Shifter - Vigilante|
|The Archetypes of Pathfinder 2nd Edition|
|Core Rule Book:||Alchemist - Barbarian - Bard - Champion - Cleric - Druid |
Fighter - Monk - Ranger - Rogue - Sorcerer - Wizard
|Lost Omens Setting Guide:||Crimson Assassin - Duelist - Guild Agent - Hellknight Armiger |
Lion Blade - Living Monolith - Magic Warrior - Runescarred - Sentry - Student of Perfection
|Adventure Path||Juggler Dedication - Staff Acrobat Archetype - Zephyr Guard Archetype|
|Advanced Player's Guide||Acrobat - Archaeologist - Archer - Assassin - Bastion - Beastmaster - Blessed One - Bounty Hunter - Cavalier - Celebrity - Dandy - Duelist - Eldritch Archer - Familiar Master - Gladiator - Herbalist - Horizon Walker - Investigator - Linguist- Loremaster - Marshal -Martial Artist - Mauler - Medic - Oracle - Pirate - Poisoner - Ritualist - Scout - Scroll Trickster - Scourger -Sentinel - Shadowdancer - Snarecrafter -Swashbuckler - Talisman Dabbler - Vigilante - Viking - Weapon Improviser -Witch|
In Dungeons & Dragons 4th Edition, the Cavalier resurfaced as a Paladin Variant Class in the splatbook Heroes of the Forgotten Kingdoms; it was part of the Essentials line of reworked classes, and its basic premise can be summed up as "simplified Paladin", just like all of the other initial wave of Essentials classes - the Knight, the Slayer, the Scout, the Hunter, the Sentinel, the Mage, the Warpriest and the Hexblade. Just like these classes, though, it suffered from the same flaw of being mono-build.
Rather than the diverse ways the paladin could serve as either tank, beatstick, or healer, the cavalier is rather set in its ways. All cavaliers start with a Defender's Aura (an at-will aura that causes -2 to any attacks to people outside of the aura), Holy Smite (an multi-use/encounter attack that adds extra damage and dazing to an at-will attack), Righteous Radiance (an opportunity attack that deals radiant damage to anyone attacking people outside the aura), Righteous Shield (an encounter immediate interrupt that lets you take the damage instead of an ally and gives you +2 to attack next turn), and Valiant Strike (at-will attack that hits more often the more people surround you). The only real choice you get is in the Virtue you select: Sacrifice allows you to spend your Second Wind to heal an ally as a minor action, and Valor gives you a slightly better healing surge and a bonus to initiative so you can get stuck in faster.
Despite being named Cavalier, this path has surprisingly little to offer in terms of making mounted combat good - only one class feature at level 4 and a power at level 8. Even then, you'd need to either buy a proper mount or replace a utility power with the Summon Celestial Steed power to make use of them.
|Dungeons & Dragons 4th Edition Classes|
|Player's Handbook 1:||Cleric - Fighter - Paladin - Ranger - Rogue - Warlock - Warlord - Wizard|
|Player's Handbook 2:||Avenger - Barbarian - Bard - Druid - Invoker - Shaman - Sorcerer - Warden|
|Player's Handbook 3:||Ardent - Battlemind - Monk - Psion - Runepriest - Seeker|
|Heroes of X:||Blackguard - Binder - Cavalier - Elementalist - Hexblade - Hunter|
Mage - Knight - Protector - Scout - Sentinel - Skald - Slayer - Sha'ir - Thief
Vampire - Warpriest - Witch
|Settings Book:||Artificer - Bladesinger - Swordmage|
|Others:||Paragon Path - Epic Destiny|