The magnetosphere, the high-latitude ionosphere, and their interactions