None of those are the same country. They are distinct countries.
And the gb / uk thing exists because of the northern ireland situation. Its an exception and a very old one and gb does not refer to uk, but uk does include gb.
Each distinct political area has one tld.
While .io might not have been registered by an inhabitant, the country code it is sourced from WAS used by people living there and continues to be used officially today.