How? Elective Monarchy.
https://en.m.wikipedia.org/wiki/Elective_monarchy
They’re part of a collective system of planets within a greater political system through the larger galactic government shown with the Republic.
It’s all about ecology and symbiote relationships, along with common types of governments during ancient times. There’s always a bigger fish.