In both the Galactic Republic and the subsequent Galactic Empire, Coruscant held the esteemed position of capital.
A capital essentially served as the central location for a territorial government.
As the nucleus of galactic civilization and culture, the Core Worlds planet called Coruscant was regarded as the galaxy's capital, functioning as the governmental center for both the Galactic Republic and its successor, the Galactic Empire. During the period of the Clone Wars, the Outer Rim planet Raxus Secundus became the operational hub for the Confederacy of Independent Systems, playing host to the Separatist Senate.
Following the Battle of Endor, the New Republic, a government arising from the ashes of the Rebel Alliance, established its capital on Chandrila. The New Republic, aiming to secure wider support and avoid the issues of the Old Republic and Empire, opted against centralizing its government on Coruscant. Instead, the capital and Galactic Senate would rotate among member worlds via elections. Approximately three decades post-Battle of Endor, Hosnian Prime held the title of New Republic capital until its destruction by the First Order's devastating Starkiller Base weapon.
Until its obliteration at the hands of the First Order, Hosnian Prime functioned as the capital for the New Republic.
Certain planets also featured their own capital cities. As an example, Theed served as the capital on the Mid Rim world of Naboo. Similarly, Mos Espa was generally recognized as the capital on the Outer Rim world of Tatooine. Furthermore, the planet Lothal possessed its own Capital City, which housed both the Imperial Complex and the Lothal City Capitol Building.