The Kidnapping of Nebula was a successful effort by the 2014 incarnation of Thanos and the Black Order to replace the 2023 incarnation of Nebula with her still Thanos-loyal 2014 self in order to infiltrate the Avengers and bring the Mad Titan and his forces to 2023.
As the elder Nebula was distant from the rest of the Avengers, the younger Nebula went unnoticed until she attempted to steal the Iron Gauntlet and the Infinity Stones - at which point she was killed by her future self, though not before the latter managed to turn the 2014 incarnation of Gamora against Thanos.
Nebula and Rhodey were tasked with retrieving the Power Stone from Morag in 2014. Unbeknownst to the two, Nebula's cybernetic enhancements forced a link between her and her past self, due to a shared network. This allowed the Nebula from 2014 to access her future double's memories.
Through this, Thanos from 2014 was able to discover their plan. After Nebula retrieved the stone, Rhodey and she prepared to return to the present. However, as Thanos and Ebony Mawwere still accessing her memories, Nebula was unable to return to the present.
Through her link, she was able to see through her double's eyes, Thanos witnessing his own death.
Nebula ran back to the ship and attempted to warn her teammates, but her ship was quickly beamed up by the Sanctuary II before she could contact anyone else.
On the Sanctuary II, past Nebula beat up her future self. Nebula attempted to plead with past Gamora, warning her of her demise at the hands of Thanos. Past Nebula kicked her and took present Nebula's orange headpiece, something the past Nebula lacks. Past Nebula then went to Thanos and kneels before him, presenting the Pym Particles and now wearing present Nebula's orange accents.