Background:I'm currently running a 5e campaign with a large number of possible NPC companions and have run Out of the Abyss (which is HEAVY on NPC companions).
The conclusion I've come to for combat is: The Companion System.
Yes, it's not part of official rules, and isn't free, but it has worked excellently.
RAW Out of the Abyss has each and every NPC use the stat block of the appropriate monster. At the beginning, there are around a dozen of these NPCs. Once I whittled it down to three, it was a bit more manageable, but still meant that I was playing a disproportionate number of rounds in combat. It felt like I was, if you'll pardon me saying so, just playing with myself. The use of multiattack from two of the characters was especially unbalanced.
I have since switched to using the Companion System from the link above. I won't go into too much detail, because the person who created it deserves your money and clicks, but it gives companion NPCs small, supporting abilities to use in combat, and puts control of them into the players' hands. Any player can choose to control an NPC at any time, as long as they aren't already "claimed".
Currently, as an example, I have a drow cleric accompanying the party. The drow can do one thing: cast Spiritual weapon, and use it. This adds a bit of damage to the 3-person party without being especially interesting, and one of the players will still get "credit" for any badassery enacted during combat. It also means one less thing for me to keep track of, which is wonderful.
Talking to yourself
As far as RP goes, I try to involve my players whenever possible. Sometimes, as odd as it is it to me (and, it seems, to you too) they actually enjoy watching the DM talk to themselves. However, in these situations, I try to paraphrase information, and then either have an NPC address a player directly, or drop hints that the party should get involved.
DM: "You come across two women in the street. They are arguing.
[doing the voice of Woman 1] This other woman has stolen my wares!
[doing the voice of Woman 2] I haven't! She's a liar!
They carry on like this for a while, arguing loudly. It looks like they might come to blows if nobody stops them."
Eventually, if your players are roleplay inclined, they'll get involved in a situation.
As for interactions with NPCs that are already part of the party, I use two strategies: the first is always asking during down time if anyone wants to talk; the second is narrating what the NPCs are doing. Often times, the response to strategy one is a resounding silence. But I like to make that space so that players don't feel like they'd be interrupting anything if they wanted to talk. As for the second option, while running OotA, making camp and resting was a common thing. I would often narrate things like:
As you settle down for the night, you can see that Eldeth is leaning against a wall and studying her battleaxe with a stony frown on her face. Jimjar seems to be practicing card tricks and looking around at everyone from time to time. Sarith is curled up with his chin resting on his knees, clutching at his head.
This helps to build atmosphere, of course, but also suggests that everyone involved has something that might be a dialogue hook; the first person is unhappy about something, the second is trying to show off and get attention, and the third seems to have a nasty headache. Now, for the record, I've never had a player whose introduction to RPGs in general wasn't through Bioware, so they all understand the idea that you should be checking up on your companions pretty regularly.
What do NPCs know?
This may sound glib, but NPCs know what they should know. The aforementioned cleric is familiar with their home temple, but not so much with the surrounding city, and certainly not the rest of the continent. The well-traveled retired adventurer, however, knows a little about everything, although it may be a little out of date. Consider the NPC's backstory first, and then decide what knowledge and skills they have.
As for bailing the party out, I count NPCs as just another tool in my box for unsticking a party. If they've gotten hung up on something long enough that they're clearly bored, I give them a little nudge. I treat these along the same lines as what I would do with any non-party NPC, and again, try to keep in mind what the NPC's skills and background are. When trying to infiltrate a temple, the drow cleric may suggest going in through a secret passage nobody else knows of, whereas a druid might suggest using their spells to bust in. This is a fiddly DM call sort of situation, and requires a good read of your players to know when they're no longer having fun beating their heads against the wall.
Not all companions are created equal. In order to avoid overshadowing or overpowering the party, most potential companions are at the slightly-underpowered level that the Companion System offers. Some are less useful, and might need some training and protection; some are more useful, and might be able to offer training.
Overall, my advice could be boiled down to:
- Use the Companion System, because it will save your life.
- Make your NPC party members integrated parts of the world, and let that inform their dialogue.