In Hungarian, the vast majority of national demonyms are the root word, with the country name being formed by adding “-ia” or “-ország”, usually the latter. There are a few exceptions, but I only remember two. (svájci=swiss, svájc=Switzerland; amerikai=American, america=America*)
Examples:
magyar= Hungarian, magyarország=Hungary
román=Romanian, románia=Romania
*this no doubt has something to do with the fact that the full name is a phrase: “amerikai egyasült államok”
Story I heard as a child: Englishman in late 19th century India talking to some Indian guy. Both influential people but the Indian guy has a limited command of English and is trying to make a good impression.
They are exchanging some small talk and the Indian asks “And who is the King of England now?” The Englishman replies “Queen Victoria”. To which the Indian man says “Ah, yes, of course, Queen Victoria… a very fine King!”.
How are names of countries formed? That’s a completely different question from the OP which asked about adjective formation. There is no one answer to this. Names are just proper names, usually named either for the ethnic group there, or something about the geography, with no particular rhyme or reason.
I’ll take Arabic for example. Countries in the Middle East tend to have native Arabic names: Misr (Egypt), al-Yaman, al-‘Irāq, Baḥrayn, ‘Umān, al-Sūdān. The only pattern I can see is the absence of a pattern. Countries in other parts of the world generally have the foreign names adapted into Arabic: Frānsiyā, Isbānyā, Almānyā (Germany < French Allemagne), Barītānyā, Amrīkā, etc. The only pattern I can see is that these names are adopted from other languages, since the ancient Arabs hadn’t known about them.