so, apart from the obvious "just learn it" , how does one tell the difference between countries prefixed with "the" and those that are not? Is there a list? Ok, The Netherlands, United States and Switzerlands are historically confederations of mini-states. As was Spain but I'm not sure whether the Spanish central government would agree it was a confederation rather than a unitary state from which Catalonia cannot secede..
By default assume they have the article before them. Most European countries do in Gaelic. Most common exceptions are Alba Scotland, Èirinn Ireland (but they do use the article in genitive: na h-Alba of the Scotland, na h-Èireann of the Ireland), Sasainn England (and gen. Sasainne of England).
Many other countries will be feminine and will have articles (or will optionally have one – sometimes there are more than one name): an Spàinn Spain, a’ Phòlainn Poland, A’ Ghearmailt Germany, An Fhraing France, An t-Seapan Japan, An Eastòin (but also Eastòinia without article) Estonia, A’ Bhulgair (but also Bulgàir without article) Bulgaria, an t-Sìn (but also Sìona) China.
I think more Asian and African countries will not have an article – those that are more recent borrowings, I believe.