What do NPCs in an role-playing game do? To put it another way, what function do they have that justifies the time spent detailing a fictional person beyond "Uhh, yeah, the blacksmith's name is Johann and he says he'll fix your armor for 25 gold pieces"?
Some types of NPCs are fairly self-explanatory, like the "Quest Giver" or the "Nemesis." Those are useful, but I want to write a little bit about a type I haven't seen people talk about much that I really like putting into my campaigns: the "Cool Friend."
The function of the Cool Friend NPC is to make the players feel like their characters are Cool just by knowing the Cool Friend.
A Cool Friend NPC doesn't have to be powerful to be Cool. Nightsong, the black metal bard from my current Krevborna campaign, is Cool because she's famous, people recognize her, and being pals with her nets the PCs respect; when people realize that the characters are friends with Nightsong, it changes how those people treat them, which in turn makes them feel Cool. They're in, they know somebody important, and a little of that swagger rubs off on them.
You can also use a Cool Friend NPC to shore up a deficiency that the party has, at least in the short term. In the previous campaign, the Widow (a sentient automaton NPC) stuck around because the party lacked any physically strong characters until more players joined the campaign. In the same campaign, Serafina (a grave robber) was a Cool Friend NPC who excelled at stealth, a skill nobody had overly invested in. Viktoria Frankenstein, from the same campaign, was a Cool Friend that the rest of the world feared and could provide medical aid unavailable elsewhere--as well as the use of her chateau as a base of operations.
If your players are smart (and why would you play with dummies?) they will realize that the Coolness of their Cool Friend can be used as a tool to get shit done. Coolness can obviously be leveraged in social situations; using their Cool Friend might open doors to them that would otherwise remain closed. As an example, in my current campaign the players used Nightsong's blasphemous, rage-filled musical performance to start a riot in a prison, and in the ensuing chaos they were able to bust an imprisoned witch out of jail. In this example, Nightsong's Coolness was something that enabled their Coolness--nobody in the setting had ever successfully staged a jailbreak from that prison, but now that group of characters has.
Of course, acquiring a Cool Friend shouldn't come too easily. A Cool Friend NPC is a bit like a good piece of loot, in that sense. You gotta put in the time to earn that shit.
Just remember that a Cool Friend is there to add to the player characters' Coolness rather than upstaging them. Being the Cool Friend doesn't mean they're a protagonist.
Besides basking in the Coolness imparted by a Cool Friend, here's the other trick: if the players think their NPC buddy is Cool, it will light one fuck of a fire under them when their friend is endangered. You will never see your players so motivated; they will move heaven and earth to save their Cool Friend from peril. Trust me on that.