Companions are, and have been integral parts of party based ©RPGs for as long as I can remember.
It's already been discussed to great length that, for any companion to stand out, they need an enticing back story and have some sort of meaningful relation to the story yet to unfold.
The above problem is usually handled fairly well, with specific honors going to Mass Effect 2 (Garrus, Tali), Planescape: Torment (Morte, Dak'Kon) and Baldur's gate II (Several characters)
However, more often than not, and not to knock those examples specifically, characters in RPG's are only really interesting from a Story & Dialogue perspective.
Bioware games in my opinion are the biggest offenders of these all encompassing class systems, with Mass Effect, Baldur's gate, and Dragon age all suffering from samish companions during combat and gameplay.
As an example, the Dragon Age: Origins characters all share the same skillsets, depending on their predetermined class (Rogue, Mage, Warrior)
Leliana and Zevran, while both rogues, each have a different specialization initially with the former being a Bard that specialises in ranged combat and the latter being an assasin that specialises in dual wielding. They can however, given enough time to advance in level, take over each other's specialisations. Essentially everyone in their respective class has the same options of advancement. This isn't inherently problematic from a gameplay perspective, but they can all pretty much be molded into what you want them to be while you're able to carry the most desired characters into battle based on their personalities, rather than their skillsets. (ideally you'd balance both)
In the aforementioned game there are two exceptions to take note of: Your Dog and Shale (a golem) both defy the class systems and have a skilltree of their own. As a Result no other companion can provide what they each provide, and vice versa. This makes them unique tactical party options. it also makes them more interesting.
Games to this very day are still struggling with this very problem.
If we look back, However, Planescape: Torment already did differentiate between companions & their mechanics in a big way.
In planescape, the first companion you meet (and get forced to party up with) is a floating skull with, I believe one or two equipment slots, very similar to the Dog from Dragon Age in that respect. This skull, Morte, has a bunch of Unique-to-morte damage reductions as well as a taunt skill called Litanny of curses. If someone in the planes were to curse excessively, Morte would take notes (how?) and improve his taunt ability. Morte improves his attack if you manage to equip different sets of Teeth on him, and Morte can further improve his statistics through story elements and Dialogue choices, as well as the good ol` experience based levelling system.
Morte is a Fighter by class, but unlike any other fighter.
The next Fighter you meet is Dak'Kon. This guy is a Githzerai, a race who live in Limbo and place great emphasis on holistic knowledge and *knowing*. Anyway, this guy is actually a Fighter/Mage, but the way he operates is, he learns spells through advancing through dialogue choices involving the circles of zerthimon, if you manage to help him come to terms with the teachings of zerthimon you can further increase his stats, evolve his character bound weapon, and increase his arcane knowledge, as well as providing you, the Nameless One, with the ability to learn spells unique to this Gith, provided you're playing a mage. (and you should be)
He, again, is nothing like the other companions.
What both of the above have in common though, is that their advancement and unique traits are meshed into the game's story and dialogue mechanics as well as combat. They also aren't balanced perfectly in comparison to the other companions, and those two facts create a more immersive and interesting gaming experience. For the same reason Brothers: a tale of two sons was so well received.
Making them diverse not only in dialogue and story, but also mechanics adds an extra layer of depth to characters, and increases player immersion and attachment to said characters.
I'd like very much for this to be a bigger concern in Pillars of Eternity, as it is in my opinion, even more so than the expert writing, what sets planescape apart as a masterpiece even to this date.