A profound human struggle exists between chasing fleeting material wealth and seeking an eternal, spiritual legacy. David expresses a deep wish to define his own destiny by contrasting these two opposing ways of life.
The primary approach among commentators is that David asks to be saved from materialistic and wicked individuals [רד״ק, אבן עזרא, מלבי״ם]. These people serve merely as an instrument of God's will in the physical world. Their entire existence is anchored in the temporary and passing nature of the present. Because their ambitions are strictly limited to the here and now, their portion in life is confined entirely to the current world, leaving them with no expectation or share in the World to Come. God grants them abundant material wealth, allowing them to enjoy all the hidden physical treasures this world has to offer. They find satisfaction in physical continuity through their children, eventually leaving their remaining wealth and property to their young heirs. [מלבי״ם] notes that such individuals are completely consumed by the physical development of the world. They use up all their spiritual merits on food and bodily pleasures, leaving absolutely nothing for the eternal life of their souls.
In sharp contrast, another perspective understands David's plea as a deep desire to be counted among the righteous [רש״י, מצודת דוד, אלשיך, ביאור שטיינזלץ]. According to this line of thought, David asks to be among those who live under God's direct care and ultimately merit a peaceful, natural death. For them, the passage of time brings a long, fulfilling life that culminates in a good old age. Their true portion is found in the eternal life of the World to Come, and they are sustained by the immense spiritual abundance that God quietly reserves for the righteous. These individuals are blessed with worthy children, passing down their spiritual merits and the fruits of their good deeds to future generations. [אלשיך] expands on this, describing these righteous people as instruments in God's hands who spiritually sustain the entire world. They enjoy only a small fraction of the reward for their deeds in this world, preserving the vast majority of it for themselves and their descendants in the future.
Building on this spiritual focus, a Midrashic interpretation suggests that those held in God's hand are the martyrs, such as Rabbi Akiva [תורה תמימה, אלשיך]. These individuals sacrificed their lives to sanctify God's name, thereby permanently securing their eternal portion in the life to come.
Finally, a unique national perspective applies these concepts to the tribe of Judah and the royal dynasty [מאירי]. In this view, those guided by God's hand are the leaders He has elevated and made successful since the dawn of history. God fills their hearts with His goodness, and the profound legacy they securely pass down to their descendants is their enduring rule and kingdom.