A traveller changing planes may need permission from a country they never intend to visit. Whether that applies depends on how the airport is built and what agreements are in place.
Airside and landside are legally different places
An international transit area sits beyond passport control, and a passenger who never crosses that control has not formally entered the country.
Where a connection can be made entirely within that area, many states require no permission at all, since no entry has occurred in legal terms.
Where the airport's layout forces passengers through immigration to reach a departure gate, the same connection becomes an entry and requires whatever an entry requires.
Terminal design decides the answer
Airports built around a single terminal with a sterile connecting corridor can offer transit without entry, while those with separate terminals often cannot.
Changing between an international and a domestic flight almost always requires entry, because domestic departure areas sit inside the country's border.
This is why the requirement can differ between two connections at the same airport depending only on which terminals the flights use.
Baggage handling is the other trigger
If luggage is checked through to the final destination, it clears customs at the end of the journey and the passenger has no reason to leave the transit area.
Where two separate tickets are held, bags must usually be collected and rechecked, which means entering the country and clearing customs on the way.
Booking a single through ticket therefore changes the legal character of a stopover, not just its convenience.
Bilateral agreements create exceptions
Some countries waive transit requirements for holders of particular passports or of valid permission for a third country, on the reasoning that such travellers pose little concern.
Others apply a requirement to everyone regardless of nationality, including passengers who never leave the aircraft on a technical stop.
These rules are set nationally and change with policy, so they are among the details most likely to be out of date in any general guidance.
Where to verify before booking
The authoritative sources are the destination and transit countries' own immigration authorities and the airline, which is liable if it carries a passenger without valid documents.
Airlines check documentation at the departure gate for that reason, and being refused boarding for a missing transit permission is a common and avoidable outcome.
Requirements vary by nationality and change over time, so confirming them for the specific passport and routing shortly before travel is the only reliable approach.