Enclaves and exclaves
geographic descriptions of territories
In geography, enclaves and exclaves are territory which (respectively) is surrounded by land which belongs to some other nation or is separated from its own parent country by foreign territory.
For instance, San Marino and Vatican City are both enclaves, as they are completely surrounded by Italy. Likewise, tiny Lesotho is an enclave completely surrounded by South Africa. Counter-enclaves (where an enclave is nested inside another enclave) are rare; Baarle is one example.
Conversely, Hyder, Alaska (or even the entire state of Alaska) may qualify as an exclave, as the only overland access from the Lower 48 runs through British Columbia or other Canadian territory. There are also semi-exclaves (where the territory is only reachable by foreign land or international waters) and pene-exclaves (which are only reachable over foreign land or by crossing domestic waters).
It's even possible for the same territory to be both an enclave (as it's a small piece of one country entirely surrounded by a foreign land) and an exclave (because entirely surrounding it this way completely disconnects it from its own parent country).
An enclave differs from a country which is merely landlocked. Landlocked Switzerland has no direct access to the sea, but has multiple neighbours which each have viable seaports – so no one nation can cut off all access to Swiss territory from abroad.
Wikipedia has an extensive list of these, but no list is comprehensive.
While there are political implications (for example, Lesotho was not free to embargo South Africa during the darkest days of the apartheid era, since it's entirely surrounded by that country), the primary impact on travel is to require border crossing (and all of the strange customs which go with it) for what otherwise should have been either a domestic trip or a trip which could have averted transit through a third country. That can cause problems during events such as the COVID-19 pandemic of 2020-21, when many borders are restricted or closed.
There's also the risk that a war could create enclaves wherever a populated place is entirely surrounded by an adversary. A country splitting into multiple smaller jurisdictions (like the former Soviet Union in 1991) will often spawn enclaves or exclaves as new international borders are established. Conversely, reunification of a divided country (like Germany and its capital Berlin at the end of the Cold War) may eliminate a few of these. Some are the result of historic mapping or surveying errors which date to a distant era when the original boundaries were drawn, while others were created (or eliminated) as boundaries changed over the years through international treaties, armed conflict or other historic events.
The same terminology has also been used for sub-national or even municipal entities. Piedmont is an enclave of Oakland, California, for instance. The term enclave has also been used figuratively along cultural, economic or identity lines, such as to identify "Chinatown" as an Asian cultural enclave within a city on some other continent, to identify a "gay ghetto" as an "LGBT enclave", or to identify a neighbourhood of multi-millionaires as an "enclave of the rich" within a larger city where others are not as wealthy.