Because the MCU hasn't achieved gender parity, it's always cause for celebration when one of the awesome women who populate it get to shine or have an interesting story arc that doesn't regulate her to bystander. Nebula, played by Karen Gillan, doesn't fit into a mold and is allowed to both be flawed and admirable at the same time. First appearing in Guardians of the Galaxy, Nebula was a big part of Guardians 2, as well as last year's Avengers: Infinity War. Avengers: She's one of the team who survived the snap at the end of that film, randomly spared the righteous wrath of her father. They have a complicated relationship, which will likely be developed further when Endgame hits theaters on April 26. What Thanos did to Nebula in her youth is still important to the story, so a recap may be in order.
As you may recall, Thanos (Josh Brolin) and Nebula have an adopted father-daughter relationship, much like Thanos and Gamora (Zoe Saldana) share. But Thanos, being the mad Titan that he is, isn't exactly a loving father, and he only came to be a parent to Nebula and Gamora because he kidnapped them and raised them as a part of his intergalactic team of mercenaries. As we learn in Guardians, Thanos trained both daughters to be ruthless killers by essentially making them abuse each other. He'd force Nebula and Gamora to fight each other, with Gamora winning most battles, and Nebula suffering the consequences.
Nebula also trained under Ronan the Accuser (Lee Pace), earning a spot on Thanos's team of assassins. Her life-long feud with Gamora for Thanos's approval culminated in Thanos ordering Gamora to abandon Nebula when they got caught in a Laser Thorn Energy Net, forcing Nebula to cut off her own arm to escape. So naturally, Nebula's relationship with Thanos isn't exactly great, and much like Gamora did, she came to hate and resent him for all of the horrible things he's done to her and the universe.
Which brings us to the events of Infinity War. At some point between Guardians 2 and Infinity War, Nebula sneaks onto Thanos's ship, the Sanctuary 2, with the intention of killing him. Unfortunately, her quest doesn't go as planned, and she's captured on the ship. Thanos then puts her in a torture chamber and holds onto her as a part of his master plan.
Later in the film, Thanos manages to capture his other adopted daughter, Gamora, and uses the sisters against one another. In order to get Gamora to divulge the location of the Soul Stone, he tortures Nebula right in front of Gamora. His method of torture is pretty gruesome, and uses Nebula's physiology against her. Nebula is a Luphomoid, a humanoid alien with blue and purple skin. But she's also part-cyborg, thanks (or no thanks) to Thanos' evil mind. In Guardians 2, Nebula reveals that Thanos would punish the loser of these sisterly fights by replacing one part of her body with part of a machine. And Gamora never lost.
Inside the torture chamber, Thanos uses the stones he does have to pull Nebula's cybernetic parts away from her body in an incredibly painful procedure. Seeing her sister in such pain, Gamora eventually discloses the location of the Soul Stone, and Thanos takes Gamora there to obtain it.
But Nebula's Infinity War arc doesn't end there. She manages to escape his ship and reunites with him on Titan. She teams up with Iron Man, Spider-Man, Doctor Strange, Star Lord, Mantis, and Dax to try and defeat the Mad Titan, but as we know their plans fail as well. Thankfully, Nebula is one of the characters who survives the snap that wipes out half of the population of the universe, and as the Avengers: Endgame trailer reveals, she joins up with the Avengers on Earth to try and defeat Thanos again.
And it sounds like Thanos had better definitely watch out for Nebula. In the Infinity Gauntlet comics on which the movies are based, she is the one who eventually takes hold of the Infinity Gauntlet and defeats Thanos, turning back time and undoing his deadly snap. That does mean, however, that Nebula gets a hold of the Gauntlet herself, which doesn't sound like the best idea either.