I'm the DM of our group with several player characters, and often there are NPCs with the party as well (partly because the party really likes persuading friendly creatures to come join them, and partly since it helps things go more smoothly as the group is generally smaller than recommended by the published adventure we're using).
Usually, the NPCs that are going along with the party are even mostly controlled by the players at the table, particularly during combat, but it's not quite them just "playing more than one character" as the specific NPCs that go along with the party often tend to change over time. (An NPC helps the characters accomplish the objective that that particular NPC wanted them to do, but then once it's done they're not as interested in continuing with whatever the party is doing next, but then some other NPC may or may not join them in accomplishing their next objective.) But then sometimes, one or more NPCs may stick around with the party for quite some time, depending on what makes sense for the character and the story.
When the party completes an encounter and thus gains some Experience Points, NPCs share in the XP awarded, per the DMG entry on Experience Points (p. 260):
When adventurers defeat one or more monsters—typically by killing, routing, or capturing them—they divide the total XP value of the monsters evenly among themselves. If the party received substantial assistance from one or more NPCs, count those NPCs as party members when dividing up the XP. (Because the NPCs made the fight easier, individual characters receive fewer XP.)
That makes sense at a high level, but then once the NPCs have earned some experience points, what do they do with them? The rules for PCs and the rules for NPCs seem to be quite different, and there isn't a concept of "levels" or a "starting amount of XP" that an NPC has. At some point should I decide that they've earned enough XP and "level them up" in some fashion, such as changing a Guard's stat block to that of a Scout or Thug or something? Do they start gaining "real" class levels and abilities at some point? Or do they just become part of the denominator when dividing encounter XP but NPCs have no use for it and it's not even worth tracking?
Obviously, I can just make up whatever answer makes sense for the particular character and story of the campaign, but I'd love to know if there was any recommended or standard approach.