[WARNING - This article contains SPOILERS for Guardians of the Galaxy Vol. 2]
When the first Guardians of the Galaxy released, director James Gunn was adamant he wanted to include more female characters in his follow-up and expand the roles of Gamora and Nebula. Having taken over the writing duties in addition to directing, Gunn has kept that promise with Guardians of the Galaxy Vol. 2, not only giving Gamora and Nebula their own sister-centric arc to explore, but introducing a brand-new character - Mantis (played by Oldboy's Pom Klementieff).
First appearing in Marvel's The Avengers #112 in 1973, Mantis' comic book history is weirder than most. She was originally intended to become the Celestial Madonna - a figure who after training with an order of Kree monks would mate with a Cotati (telepathic plant beings) and give birth to the Celestial Messiah. Life didn't really pan out that way for Mantis, but being taught to communicate with the Cotati is what allowed her empathic abilities to develop. She eventually winds up with the Avengers for a period, helps them battle Loki and Dormammu during the Avengers/Defenders War, and later takes on an astral form in order to fly off into space with her husband, The Swordsman. (The 1970s was a strange time, especially for comics.)
From there, Mantis would occasionally appear throughout Marvel continuity (and weirdly, that of other publishers, too), but never in a meaningful role until the 2007-2008 crossover event, Annihilation: Conquest. During that tale, she helps Peter Quill, Gamora, Drax, Rocket, and Groot escape from a Kree prison. They weren't yet the Guardians of the Galaxy, but at Quill's insistence (and with a little help from Mantis' powers) they end up coming together as that ragtag group of A-holes.
In this modern iteration of the Guardians, Mantis is a founding member, but her inclusion in Guardians of the Galaxy Vol. 2 is quite different from her Celestial Madonna roots. To begin with, the Guardians are already an established team, having done their whole "getting the band together" shtick in the last movie. It also isn't the entire team who first meet Mantis, but rather just Star-Lord, Gamora, and Drax. There's no Kree prison in this introduction either, though Mantis does play a key role in helping the Guardians escape. And she may not be destined to give birth to any Celestial Messiah (at least not in this movie), but the MCU's Mantis does share a strong connection with at least one Celestial being - Ego, The Living Planet.
Mantis was found by Ego when she was only a larvae and brought back to live with him (or on him, if you'd prefer, seeing as he is the planet). The exact circumstances upon which Ego found Mantis are never expanded on, making it unclear if she was abandoned, had her species wiped out, or worse, was simply kidnapped by Ego. Regardless of how she ended up with him, Mantis has had very little contact with other living beings outside of Ego and is therefore quite shy and naive. She doesn't really understand others' customs and that makes for some awkward interactions. It's through meeting Peter, Gamora, but mostly Drax, that she begins learning how regular, mortal beings interact, becoming more open to their perspective the more time she spends with them.
In Guardians of the Galaxy Vol. 2, Mantis is still an empath who can sense others' feelings through touch. And being able to read those emotions, she can also then manipulate them. For instance, if someone were happy she could make them feel sad, and were they anxious or stressed, she could calm them. In addition to sensing and manipulating emotions, Mantis is also able to induce sleep -- even in a being as powerful as a Celestial if she can muster the willpower.
It's for this purpose that Ego keeps Mantis around, with her at one point explaining to Peter that she uses her abilities to ease his father's loneliness, bestowing on him a peaceful feeling so he can sleep. In actuality, Ego needs Mantis to induce sleep because as an immortal Celestial god-being, he cannot naturally fall asleep as a mortal being would. So while traveling the cosmos in his humanoid, Kurt Russell-form - planting the seeds for his evil expansion - she's basically his regular dose of Ambien.
She may begin the film aligned with Ego, but that's only because Ego is the only anything she's ever truly known. Spending time with others besides Ego helps her to realize there is more to life than being his servant. And when it really it counts, Mantis betrays her "master", using her powers to incapacitate him and buy the Guardians enough time to destroy him.
Mantis is already set to return for Infinity War and Guardians 3, so expect her to be a fully-fledged member of the Guardians of the Galaxy next time we see her. She's certainly earned it, proving she too can overcome a terrible upbringing and become a hero just like the rest of these A-holes.