system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What needs to happen for a plane to fly into other countries' airspaces?

When a plane crosses another country's airspace in its journey, what happens? Does that country's air force get all airplane schedules of the day ahead of time and verify that? Or is there a database of planes flying that we don't know about?
gpt
If it's playing nicely then it will have a filed a flight plan and be carrying a transponder which identifies it, so air traffic control are expecting it and know which plane it is when it appears on their radar.

If not, and it doesn't respond to air traffic control asking what it's doing, then fighters would be scrambled to go and see what it is, and eventually shoot it down if the appearance of fighters doesn't make the pilot more talkative.