King David highlights God's choice of his successor, making it clear that out of the many sons who could have inherited the crown, Solomon was specifically chosen. This selection rests on two main foundations: an early promise David made to Bathsheba, and a prophetic message delivered to him at the time of Solomon's birth [ביאור שטיינזלץ].
Beyond the basic appointment of an heir, the emphasis on Solomon being selected from such a large number of sons carries a deeper message about David's own moral standing. The fact that God specifically chose Bathsheba's son from among so many potential candidates indicates that David's marriage to her was not a sin. Had their union been sinful, her son would never have been elevated to the kingship while other worthy candidates were available [מצודת דוד].
However, this divine appointment is not an unconditional guarantee. Solomon's royal destiny and the promise of an eternal dynasty completely depend on his ability to remain steadfast and strictly follow God's commandments and laws [רלב״ג].