So in my most recent campaign I have planted a NPC droid companion in the party to act as a ally and to nudge the players in the right direction until the "new group syndrome" wears off and they do so on their terms. He's a K2 droid who got most of his memory fried in a midlife crisis and is looking to seek his way in the galaxy. Since the PCs are rebels he will be assisting them and I hope he will grow on them. He'll be that badass guy who does no look kills and say some quippy droid one liners and over time I hope that the PCs will grow quite attached to him.
However he is using the PCs and the rebellion to relearn about the galaxy and establish connections. While he certainly does not like the empire, he sees the rebellion as a fruitless cause and a means to an end. Luckily a-lot of the campaign will be in the CSA so theres plenty of opportunities to be bought. He will betray the PCs and bring about a serious spanking of their rebel forces midway through the campaign. He then will receive some favor and leave to be a independant mercenary or perhaps join a existing seedy organization. Any tips on how to do it? How to twist the serrated vibroknife? How to make a moment memorable and the PCs clawing for revenge?