The Free On-line Dictionary of Computing (30 December 2018):
Originally, a two-letter abbreviation
for a particular country (or geographical region), generally
used as a top-level domain.
Originally country codes were just for countries; but country
codes have been allocated for many areas (mostly islands) that
aren't countries, such as Antarctica (aq), Christmas Island
(cx) and Saint Pierre et Miquelon (pm).
Country codes are defined in ISO 3166 and are used as the
top level domain for Internethostnames in most countries
but hardly ever in the USA (code "us"). ISO 3166 defines
short and full english and french names, two- and three-letter
codes and a three-digit code for each country.
There are also language codes.