The Fighter is one of the basic classes in almost every RPG system ever made.
The fighter's primary role is serving as a meat shield and smashing things. Fighters can wear armor and use powerful weapons. They are also traditionally good at physical activities like jumping, riding animals, balancing, and drowning under the weight of their own armor. Without fighters, a party typically needs to replace them via summoning or enchantment to ensure that the GM doesn't casually pick off at least one party member on any given day.
Dungeons and Dragons
In D&D the Fighter class has existed since the very first incarnations (then called "fighting-man").
In the 1st editions, the fighter's strength was endurance. His killing power lasted far longer than that of magic-users, as he could not run out of sword. Players who rolled 18 Strength at character creation got the benefit of an "exceptional Strength score", metered strangely in the format "18/nn", (where "nn" is the roll of a d100) could add as many as 6 points of damage to every hit for those who received the blessings of the dice gods. By rule, it was possible for a fighter to obtain a level of armor fairly early on that made him unhittable unless the attacker rolled a natural 20. This even worked against touch attacks, as the rules granted them no bonus to hit. Fighters could also mass many hit points. Gear loss was not a problem in 1e, as the fighter could wear any armor and use any weapon that they found.
A little later, the Unearthed Arcana book first added weapon specialization (and weapon mastery, then named double-specialization), allowing fighters to improve their damage even further and attack more than once per round, further improved by level.
However, the fighter's "saving throw" defenses against special attacks were absolutely wretched, making him a sitting duck for paralysis, petrification, breath weapons, death magic, magic wands, spells, and most horribly, poison, which was everywhere in 1e and meant almost certain death. Many found playing a 1e fighter boring because every problem was solved in largely the same way, and found the extra dice rolling to be a chore rather than a pleasure.
Fighters in 2nd edition continued all of the trends from 1st edition. 2nd edition spellcasting was limited by onerous regulations, costly material components, and the likely permanent crippling of the caster, making fighters the kings of the 2e battlefield. They had the best "THAC0" chance of any class to hit enemies. In 2nd edition, fighters received bonus attacks based on their level, and these bonus attacks had no penalty to hit. With new 2e rules for bows allowing 2 shots per combat round at level 1, with the common sheaf arrow dealing an entire d10 "hit die" worth of damage, and with the advent of the "Odysseus-style" composite longbow adding Strength bonus to arrow damage, fighters were a serious threat at any range. The (optional) proficiency system meant that fighters couldn't quite achieve the "pick up anything they find and use it" levels of gear efficiency that they had in 1st edition, but since the fighter's penalty for using a weapon unskilled was only -2 to hit, and the nonweapon proficiencies were mostly worthless medieval fluff like Cobbling and Heraldry, Fighters still weren't particularly worried about Rust Monsters and Ethereal Filchers nicking all of their stuff.
Weapon specialization got added to the Player's Handbook and became a standard, further improving the fighter's combat ability. Around the end days of the edition, the notoriously unbalanced Player's Option line of books further developed this into weapon mastery, high mastery, and grandmastery, which allowed the fighter to swing his chosen weapon even faster, crit more often, and even increase the damage dice to the next highest. A grandmaster swordsman could swing his bastard sword four times in a round, dealing 1d20+3 instead of 1d12 damage against an ogre or a dragon or something. Meanwhile, his buddy, the fastest dart-thrower in the Sword Coast, gets to throw seven darts for 1d4+7 damage each and one out of four will crit, and only a natural 1 would miss. No high-level fighter with a DM stupid enough to allow him to use these rules was to be fucked with in 2nd edition.
In 3.x, the advent of Feats was supposed to make fighters more attractive to play. The fighter gets loads of feats, making it the only class that can take more than one full-size feat tree (Archery, Weapon Specialization, etc.) But feats brought a nerf in disguise. Fighters could no longer use the best weapons like the "spiked chain" without spending feats to do so, or taking a significant -4 penalty to hit. The only fighter feats really worth getting involved a horrible exploit in 3.0 called "the bag of rats" (the fighter dropped a bag full of rats in front of an enemy, then used Whirlwind Attack feat to attack all the rats in a single round, then used Great Cleave to get a free attack on the enemy for each rat killed. This was clobbered in 3.5.) There were other nerfs as well. Bonus attacks received hit penalties that made them nigh-worthless. Bow rate of fire and damage was nerfed, and crossbows, which any character could use, got a significant damage increase. The new skill system overtook things that any character could do in previous versions of the game, and with their tiny number of "skill points", fighters became helpless bumbling buffoons in just about everything.
Meanwhile, spells became so powerful that a single caster could bring down entire armies in one or two rounds. The result was that your party was better off having any character with Summon Monster I than with a fighter. Fighter became something you multi-classed your rogue or cleric into for one or two levels, in order to get their level 1 automatic feats, Martial Weapons, Tower Shields, all armors, +d10 hp, full attack bonus, and a bonus feat. It was still a scrumptious dip class for those first few levels, but it was generally best left behind afterwards.
Fighters are generally a little beefier and a lot better in Pathfinder, with more unique passive benefits other people don't have, while keeping their big pile of feats, and fewer classes that can be described as "like a Fighter but better." They don't have the raw power of the spellcasting classes, but they're now actually very good at their actual jobs, namely, killing tons of dudes while shrugging off damage, while many martial and exotic weapons, particularly archery, are more attractive options. The archetype system also helps them a lot, sacrificing much of their versatility in terms of weapon use to make them even deadlier or tougher with a single combat style. (Two-handed weapon, sword-and-board, unarmed combat, etc.)
Unfortunately, with a pitiful dribble of skill points and limited skill selection anyway, they don't tend to be much use once things are actually being done out of combat, barring pure roleplaying or trait-use to gain one good skill. A lot of the time, if no fighting's going on, the fighter's player may as well just go off to use the restroom or crack open a soda for all the use he'll be. One way around this is to take the Tactician archetype, which gives them a lot more skill points and class skills, offers great bonuses and buffing capacity for having high mental stats, and barely reduces their combat effectiveness in the bargain. The only real price is a little bit of MAD trouble, but if you rolled well on your scores and want to make a character who can kick ass and still be the charismatic and intelligent party leader, consider it.
Another avenue of approach is the combination of the Lore Warden and Martial Master archetypes. The Lore Warden trades in medium and heavy armor and armor training in favor of better ability to trip, grapple, sunder, disarm, and perform other combat maneuvers, a +2 bonus to attack and damage after making a successful knowledge check, an extra two skill points, all knowledge skills, the ability to negate critical hits, and the ability to automatically confirm a critical hit on a knowledge check. It does a good job of making the Fighter have more skills and variety in combat. However, combining it with the Martial Master allows you to flexibly pick up combat feats as you need them, like a Brawler. that means you aren't locked into a single static configuration, and can change up how you fight on an encounter-by-encounter basis. Invisible enemy? Take blind-fight! Flying enemy? Grab ranged feats! DM gives you an exotic weapon that you need to kill a boss with? EWP. It makes up for the fighter's weakness in being able to kill dudes quickly but only in one specific way.
In 4th edition, the Fighter is listed as a "Defender". His main purpose is to serve as a meatshield and prevent the enemies from getting close to the squishies behind them. Fighters do more single-target damage than any other class in the game that isn't a "Striker" (and in some cases can out-damage strikers, especially if they get a lot of opportunity attacks). They also make the squares around them a living hell for any marked foe who tries to move through them at all. They come in five flavors: "Great Weapon" (uses two-handed weapons, considered to be a striker "by the back door"), "Guardian" (the archetypical 4th Edition fighter, uses a one-hand weapon and a shield, has primary access to most of the best Fighter powers including the truly awesome Tide of Iron at-will), "Battlerager" (a berserker fighter build, lives on yummy, yummy, temporary hit points), "Tempest" (a two-weapon fighter build for those who feel like they cannot live without a two-weapon warrior who wears heavy armor), and "Brawler" (uses a one-handed weapon, but leaves the other hand open so they can grab people to use them as human shields, break faces, or snap necks).
In 5th edition, the Fighter is the only class who hangs onto 4e's Healing Surge (called Second Wind, and usable once per short rest, granting 1d10+Fighter level). He also has more feat opportunities, and since you can use those for either 2 stat points or 1 feat, fighters are likely to have 20s in any stats they want and still have slots left over for feats. They can go into one of four subclasses: the Champion, which gives him more sustain and tankiness with more-frequent crits and physical ability score checks (including initiative); the Battle Master, who can perform maneuvers in combat to control the battlefield, help friends and inconvenience enemies; the Eldritch Knight, who casts spells and swings swords, and eventually can cast and swing at the same time; and, as of the Sword Coast Adventures Guide, the Purple Dragon Knight (whose setting-neutral name is given as "Banneret"), whose gimmick is that he can give other party members fighter powers and so he basically serves as an option to play a Warlord. The Fighter also eventually gets four attacks (twice as many as any other class), saving throw re-rolls, and is capable of dealing tons and tonnes of damage.
Other classes might spike higher, but between the largely-short-rest-recharging powers and high natural sustain, fighters can operate at peak efficiency even on grueling grinder-days. And when one of the biggest problems with the 3.5 fighter was his bland lack of class features or nice skills, between the reworked skills and backgrounds system and his cannibalization of nice things from 4e, the fighter is certainly his own man this edition, able to contribute outside of combat as well as any other non-spellcaster.
The Kits of Old Unearthed Arcana added two new subclasses for the Fighter; the Cavalier (who's your same old useless gimmicky mounted warrior/knight) and the Scout (who's basically a better Ranger than the 5e Ranger).
The Gothic Heroes UA article adds the Monster Slayer archetype for the Fighter. Like many of the other fighters, he makes use of Superiority Dice, but his are more limited in use; add one to an attack roll, add one to a damage roll, add one to an Int, Wis or Cha saving throw, or add one to Wisdom check made either to detect a hidden creature/object or to determine if someone is lying. These are initially d8s, but upgrade to d10s at 10th level and to d12s at 18th level. Likewise, a Monster Slayer starts with 4 superiority dice to use per short rest, but gains +1 extra at 7th and 15th levels. He gains bonus proficiency in any two of Arcana, History, Insight, Investigation, Nature or Perception, can cast Detect Magic as a ritual and Protection from Evil & Good once per long rest as a spell-like ability, and at 7th level gains the Monster Slayer trait. This A: lets him spend two superiority dice for extra damage instead of one, and B: means that when he does so against an aberration, fae, fiend or undead target, superiority dice deal their maximum bonus damage automatically.
November 2016 gave them four more archetypes; the "magic via bowshot" Arcane Archer, the Knight (a sort of tankier Cavalier), the Samurai (a super-tanky fighter) and the Sharpshooter (a master of ranged combat).
|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 - Elementalist - Hexblade - Sha'ir - Vampire - Witch|
|Settings Book:||Artificer - Swordmage|
|Others:||Paragon Path - Epic Destiny|
|Dungeons & Dragons 5th Edition Classes|
| Barbarian - Bard - Cleric - Druid - Fighter - Monk |
Paladin - Ranger - Rogue - Sorcerer - Warlock - Wizard
|Artificer - Mystic|
|The Classes of Pathfinder|
|Core Classes:|| Barbarian - Bard - Cleric - Druid - Fighter - Monk |
Paladin - Ranger - Rogue - Sorcerer - Wizard
| Arcanist - Bloodrager - Brawler - Hunter - Investigator |
Shaman - Skald - Slayer - Swashbuckler - Warpriest
| Alchemist - Antipaladin - Cavalier |
Inquisitor - Oracle - Summoner - Witch
| Kineticist - Medium - Mesmerist |
Occultist - Psychic - Spiritualist
|Ultimate X:||Gunslinger - Magus- Ninja - Samurai - Shifter - Vigilante|
| Aegis - Cryptic - Dread - Marksman |
Psion - Psychic Warrior - Soulknife
Tactician - Vitalist - Wilder
|Path of War:||Harbinger - Mystic - Stalker - Warder - Warlord - Zealot|