A familiar is a magical spirit in the shape of an animal (or something vaguely like an animal) which serves as a loyal minion to a witch, warlock or wizard. Originating from real-world beliefs about witches, it is a concept that has been deeply invested in many roleplaying games.
Dungeons & Dragons
Back in those days, wizards had fairly mundane familiar options - cats, rats, snakes, toads, bats, ravens, etc. However, certain sourcebooks introduced the idea that various magical creatures, such as dragonets, could also become familiars under the right (DM-mandated) circumstances. Familiars were mostly a role-play tool, but there were serious penalties to be had if your familiar died - anything from the loss of levels to potentially dropping dead on the spot!
3rd edition essentially brought familiars over unchanged in mechanics - except in one detail. Now, the PC could take a feat called Improved Familiar; ordinary familiars gave a small bonus, usually a +2 to a specific skill, but Improved Familiars were more powerful, combat-capable creatures. The precise list of Improved Familiars and alternative familiars grew over myriad sourcebooks, to the point that players could have beasts like hippogriffs and worgs under their command.
4th edition changed that by completely removing the familiar at first. As they pointed out, familiars had traditionally not been very well regarded; they were most ignored by players and considered more of a detriment than an advantage, since they were so frail and inflicted so much damage on the player if they died. Familiars didn't resurface util the Arcane Power sourcebook, where taking a familiar became a Feat available to any Arcane class. Now, your familiar can switch between a passive move, in which they are sharing the player's space and immune to attack, or an active mode, in which they can move independently and use a special power depending on the familiar. For example, spiders can be used to haul small objects to different places with their webbing, whilst ravens can become living videophones for you Plus, if your familiar gets killed, it automatically comes back to life good as new the next time you complete a rest.
5th edition mostly takes its lead from 4th edition. Familiars are no longer a default option; instead, arcanists have access to a 1st level spell called Find Familiar, which summons a magical spirit in the form of one of various little beasties. It no longer can attack, but neither can it be killed permanently and its death has no negative effect on you. Its main use is to serve as a spy and as a conduit for spells that normally have a range of "Touch".
Pathfinder's take on familiars is essentially the same as in D&D 3rd edition.
In both Warhammer Fantasy and Warhammer 40,000, familiars are a kind of lesser daemon that Chaos Sorcerers have traditionally been able to take as wargear. Daemonic familiars come in a vast array of shapes, but over time have had their roles simplify. For example, Warrior Familiars are unusually strong and aggressive for their kind, and generally provide some free attacks to their master.