As Padmé Amidala's head of security and one of her most trusted inner circle members in Star Wars: The Phantom Menace, Quarsh Panaka was a key figure in the Star Wars prequels. However, the once-loyal soldier later went on to betray the former Queen-turned-Senator and all she stood for, while subsequently nearly doing the same to her daughter, Leia Organa. Despite never moving against her directly, Panaka ultimately undermined the cause of freedom that Padmé Amidala fought for in life.
Captain Panaka was a member of Naboo's Royal Security Forces and always harbored strong and unwavering opinions that were often contradictory to those held by Queen Amidala, but defying orders was never in his vocabulary. He outwardly disagreed with the methods of Qui-Gon Jinn and his apprentice, Obi-Wan Kenobi, during the dispute with the Trade Federation, and he was not afraid to voice his concerns. The only moment the head of security showed any kind of joyful emotion on-screen was when he announced in The Phantom Menace to Padmé that Palpatine had been nominated as Chancellor of the Republic. In Queen's Shadow, Panaka is said to have been a supporter of wanting a stronger military presence on Naboo, a stance that was in direct conflict with what Padmé wanted, but as such was in direct alignment with Palpatine and the way of future Imperials.
Related: Star Wars: How Princess Leia Joined The Rebel Alliance
Though he was a steadfast protector of the monarch, Panaka ultimately allied himself with Star Wars' ruthless villain, Emperor Palpatine, leading the people of his native Chommell sector as a Moff, which included the Naboo system. In Legends, Panaka became a part of the very thing that the person he had once protected was fighting
Read more on screenrant.com