I have been taught that it's grammatically proper to use the before countries like "Sudan and Yemen" but I was never given a reason (if there exists any, of course) when I asked why, except for "it is one of those ambiguous parts of English language that we – as non-native speakers – should just accept without trying to look for a reason". Now, I'd like to know if there is any answer to this "why" or I should keep on believing that there are no hard and fast rules when it comes to questions like these.
The naming of countries is a matter of politics and convention rather than grammar. It is no longer appropriate to say the Ukraine, for example, as the government of that country deprecates it, and some may even be insulted by it.
Ultimately, each country can declare whatever its official and short names will be in English, although it may not always stick in common usage. Holland referring to the Netherlands persisted well into the second half of the 20th century, and Burma remains Burma, perhaps in part to spite the generals who insist on Myanmar.
The article is used where
the name of the country includes a common noun, usually indicating the type of state; thus Russia but the Russian Federation, Britain but the UK and the United Kingdom, and the UAE and the United Arab Emirates. Naturally, the formal name of a country almost always entails the article: China but the People's Republic of China (or for stalwarts, the Republic of China), Jordan but the Hashemite Kingdom of Jordan, Gabon but the Gabonese Republic.
There are exceptions, as always: in Ivory Coast has more than half as many examples as in the Ivory Coast, and it is Vatican City, not the Vatican City— although the latter is also known as the Holy See.
the name refers to a geographic or cultural region, a group of islands, or another feature or landmark: The Bahamas, The Gambia, the Comoros, the Netherlands, etc. As far as I can tell, The Gambia and The Bahamas seem to be the only countries which prefer the article always be used and always capitalized. (Among cities, we have The Hague and The Bronx, and a few others.)
The second case is where the has been dropped from many country names; the reference to the country as a region within something larger is taken by some to have colonialist overtones. Thus, what were the Lebanon [mountain], the Argentine [river], the Ukraine [=border region], and the Sudan [desert] a few decades ago are today Lebanon, Argentina, Ukraine, and Sudan properly.
Where a name is imported wholesale from another language, any article in the original language is ignored. Thus, El Salvador, not the Salvador, and likewise subnational entities like Le Havre or Los Angeles.
I have some additional questions on articles and proper nouns linked in the other thread.
Looking at the names of countries as listed by the British Foreign Office, the article 'The' is never used.
In the past, certain countries were officially named with an article. This practice seems to have died out entirely. The most recent country I can think of to lose the article in common usage is Former Yugoslav Republic Of Macedonia.
There has been discussion of "The Ukraine" on ELU where it is said to be insulting.
The best rule to apply is, if the country calls itself The xxx, then use The.
No article is used with the names of most countries. "The" is used with country names with "of", or the names of island countries.
Use no article with a single-name country. Use "the" before countries with "of" in the name: The Repuplic of…, The United__of…, The Democratic __ of… , etc. And use "the" before island countries: the Philippines, the Maldives,