A divine census takes place, one that looks past physical borders and current addresses to reveal the true spiritual origins of humanity. This heavenly recording pays special, eternal attention to Zion and her children. God conducts a careful tallying and counting of the nations [מלבי״ם]. The primary approach among commentators is that as God records the nations of the world, a specific distinction is made for those whose true home is the city of Zion [אבן עזרא].
Looking toward the future, this divine record serves as a promise for the gathering of exiles. As God registers the nations, He will carefully count and extract the Israelites who were absorbed into foreign lands or forced into hiding. He will pull them from among the nations and testify that their roots and ancestors belong to Zion, regardless of their hidden identities [רש״י, מצודת דוד]. In a similar way, anyone across the globe who knows God and remains close to Him will be called by the name of Zion, treated exactly as if they were born within its walls [ביאור שטיינזלץ].
Alternatively, this heavenly writing connects to an ancient divine decree. When God originally drew the borders of the nations, He specifically destined Zion to be a place of praise, decreeing that a multitude of wise individuals would be born there [רד״ק]. The sheer number of these wise people is so massive that only God, using the heavens themselves as His scroll, is capable of calculating their exact count [אבן עזרא].
Finally, this recording can be understood as an ongoing, annual event during the time of judgment. On the New Year, all people pass before God to be counted and written into His books. At this moment of judgment, God refuses to associate the people of Israel with the foreign lands of their exile or with their enemies. Instead, He continues to declare that their true origin is in Zion, forever linking them to their spiritual home even after the destruction of the Temple [אלשיך].