The phrase 'sukkas david ha'nofeles' originates in the prophecy of Amos 9:11, where God promises to raise up the fallen booth of David, mending its breaches and rebuilding it as in days of old.
Rashi (Amos 9:11) and Radak on Amos 9:11 both explain that the 'sukkah' here is a metaphor for the Davidic monarchy, which had fallen and would be restored, with the Radak noting that the sukkah image conveys the dynasty's role of sheltering the people.
Metzudat David on Amos 9:11:1-4 similarly reads the verse as God's promise to restore the kingship to the house of David after its fall and ruin during the exile, rebuilding it as it stood in David's own day.
Malbim on Amos 9:11 traces the historical decline from a stable Davidic house to a temporary 'sukkah' of leadership under the nesi'im, and finally to the utter fall of even that remnant, which will one day be raised again.
Mishneh Torah, Melachim and Wars 11:1 frames this restoration in halachic terms, describing the future king Mashiach as the one who will return the kingship of the house of David to its former sovereignty, rebuild the Temple, and gather the dispersed of Israel — giving the 'sukkas david' petition its practical, messianic content.
The Maharal, in explaining the structure of the Amidah's blessing of restoration, notes that the sages instituted mention of the kingship of the house of David precisely there because it represents the completion of Israel, drawing the same image of a fallen and to-be-restored davidic house invoked in the Grace after Meals petition (Maharal).
Sulam on Zohar, Pinchas 856 links the raising of the fallen sukkah of David to the raising up of the Shechinah itself, described as unable to rise on its own but only through a higher configuration — tying the 'nofeles' language of Amos to a broader theme of restoration through divine intervention.
Sukkot's own imagery of dwelling under divine protection, as reflected in Sulam on Zohar, Emor 264 regarding the clouds of glory sheltering Israel and in Sefat Emet, Devarim, Sukkot 22:3 regarding the protective quality of the sukkah, resonates with the same motif of shelter and its potential collapse that undergirds the Davidic sukkah imagery, even though these sources speak of the wilderness sukkah rather than the monarchy directly.
Sukkah 52a:1 situates the end-of-days restoration in the context of a future eulogy for the house of David, associated with the death of Mashiach ben Yosef, showing that Chazal already connected the final redemption of the Davidic line to a moment of falling before rising.
Tzitz Eliezer (19:25) connects proper observance of the sukkah with being blessed in one's endeavors, ultimately linking it to the future dwelling in the sukkah of the Leviathan's skin and the witnessing of the restoration of sukkas David, drawing the practical mitzvah of sukkah directly into the messianic hope expressed in the petition.