Quote Originally Posted by Friv View Post
I don't think there's a version of D&D (or any RPG, for that matter) in which NPCs gain XP at the same rate as PCs. Back in Basic, retainers got half the XP of PCs, and hirelings got none. So right off the bat, some dude tagging along to stab a thing with a sword didn't level up at all and a moderately skilled adventurer working with the players took twice as long to level up, until a player inhabited them (PCs could take on retainers as their new PC if their original died), at which point they started powering up faster.

3rd Edition D&D says that having an NPC in your party reduces how much experience the PCs get, but also says that only PCs gain XP. I'm pretty sure that 4E and 5E say the same thing, but if anyone has a specific reference I'd take it.

With that in mind, no, most characters can't go stab six goblins and level up, because the spotlight isn't currently on them. It's not even that the PCs are inherently special characters; if the game fast-forwards a year, by default you don't get any XP for the war your fighter won, even if you say that he killed a dragon during it. XP is generated by a character being under the spotlight with a player controlling them.
At the very least, in my 5e game, the way I'm running it, NPCs don't gain XP but take a share of it anyway if they participated in the encounter. The one NPC for whom this matters is a level 2 cleric in a party of level 5 adventurers. I'm basically keeping him at half their level, round down. I may decide to change this to their level-2 if I decide I really want them to have higher-level cleric spells on-hand.