From 1d4chan

Retainers or hirelings are backstops-for-rent in role-playing games.

Retainers have helped out undermanned gaming-tables since the old days of Dungeons & Dragons. Tom Moldvay detailed them in his red Basic book but warned inexperienced DMs away from using them yet. For Moldvay-n'-Mentzer, they are NPCs with their own level-progression; but they don't make their own decisions, so make only half the XP. Which is not to say that the retainer (nor henchman - we'll get to him) will obey every command; there's a loyalty-check mechanic. Moldvay in particular believed that the hiring of retainers should itself be a roleplaying opportunity.

Related, in older-school D&D, is the henchman. He is a ... groupie. Seriously: he serves for free out of "admiration" for the PCs. Henchmen don't flock to Basic-level parties like those which Eric Holmes was serving, and M&M both thought they were stupid. But in Advanced Dungeons & Dragons they are a thing in both 1e and 2e. Once the party gains a rep - as in, they're Expert level - the henchies will be coming. Listen for their "NOTICE ME, SENPAI" mating-call. And if the retainer thinks the party is awesome enough he might end up a henchman.

Moldvay tried to distinguish "retainer" from "hirelings", the latter which he promised for the Expert level. The actual blue book we got detailed all sorts of specialists and mercenaries that might be hired to work on specific tasks beyond "take the pie away from the orc". And oops, "forgot" to mention henchmen.

The rules survived in a somewhat simplified format in Dungeons & Dragons 3rd Edition, and were largely gated behind feats.

Dungeons & Dragons 4th Edition left them out of the Player's Handbook and Dungeon Master's Guide, but added them back in with an Unearthed Arcana article in Dragon Magazine #397 - Strongholds having returned in Dragon #395.

As lower-deck sorts of NPC, traipsing around a party of characters whose players tended either very young or socially-inept, the farcical potential of a "henchman"-focused storyline (usually technically Retainers) became too good to pass up. Knights of the Dinner Table and (especially) Nodwick explored these themes to great effect, landing both comics runs in Dragon Magazine.