You have the broad outline, DEVELOPER_FAQ.txt has a little bit of detail about the structures involved (at the end of the doc)
The main thing to understand is that the curently-active part of the map shifts around to keep the player centered, when an entity moves on the map, their coordinates are updated, but as a special case, when the player steps from one map tile to another, the active part of the map and all loaded entities shift under the player to keep them centered. We have consensus among the developers that we’d like to get rid of this shifting thing in favor of having everything keep track of absolute coordinates, but there’s no telling when it’s actually going to happen.