The imagery of righteous individuals as thriving trees highlights the unique environment where they grow and how this setting fuels their spiritual flourishing. These individuals are firmly rooted and established in their place [מצודת ציון, מצודת דוד]. Alternatively, this rooting is viewed as a process of being uprooted from one location and carefully replanted in another [מלבי״ם]. In this setting, they put forth flowers [אבן עזרא], a metaphor for their success, prosperity, and growing wisdom [רד״ק, המאירי].
The primary approach among commentators is that the righteous are granted long life and protection because they take shelter under God's shadow [ביאור שטיינזלץ]. They make His house their permanent home, dedicating themselves to the pursuit of Torah and wisdom [מצודת דוד, רד״ק, המאירי]. The relationship between God's house and His courtyards can be understood as a poetic repetition emphasizing the same concept [מצודת דוד]. Alternatively, it reflects the different groups within the Temple. The house represents the inner circle of Priests and singing Levites, while the courtyards represent the gathering place for the rest of the Israelites [רד״ק]. In this view, the spiritual devotion of those serving inside the house radiates outward. As they blossom, everyone praying in the outer courtyards experiences the fragrance of their service and is deeply influenced by it [אבן עזרא].
Taking this imagery beyond the physical realm, the courtyards and the house represent the transition between two worlds. The courtyards symbolize the current physical world, acting as an outer hallway. Here, the righteous blossom by building a lasting legacy through their descendants or ongoing leadership, much like kings who are anointed in the courtyards to establish a dynasty [מלבי״ם, אלשיך]. The house of God, however, represents the World to Come and the realm of souls. When the righteous complete their purpose and are uprooted from the physical world, they are replanted in God's heavenly house, where they continue to thrive and exist for all eternity [מלבי״ם, אלשיך].