Obviously, this isn’t true for all ccTLDs as some are popularly used for a certain context such as .tv to refer to television programs and stations around the world or .co which was given to Colombia but is favored globally due to its closeness to the .com TLD.
Nevertheless, the ccTLD is generally a proxy to know where a website originated despite these exceptions. For this reason, ccTLDs are typically used for government websites, national media outlets and other nationally-focused organizations (one exception is .gov for the US). But how many of these sites are actually hosted within that particular country? The answer is: it varies widely ranging from as low as 25% for .gr and up to 90% for the .jp ccTLD.
Some countries may simply lack the infrastructure to host locally but it’s worth examining where sites are located and whether this is in accord with national security goals.