A legacy of profound wickedness often leads to total ruin, yet the royal dynasty of Judah survived a period of severe moral failure. The historical accounts of Judah during this era refer specifically to its kings [מצודת דוד]. King Jehoram and his household strayed so far from the right path that they deserved complete destruction. His crimes were severe, going so far as the murder of his own brothers [אברבנאל].
Despite these heavy sins, God held back from wiping out Jehoram's descendants [ביאור שטיינזלץ]. The royal family was spared not because of their own merit, but due to a historical covenant. God had made an enduring promise to David, rewarding him for being a faithful servant. This divine guarantee established that even if David's descendants were to sin and abandon the Torah, they would face punishment and suffering, but the crown would never be entirely taken from them [מלבי״ם].
True to this agreement, Jehoram did not escape consequence. His punishment arrived in the form of an Edomite rebellion that erupted during his lifetime, bringing hardship without bringing his rule to a permanent end.
The core of this enduring promise is the guarantee of an unbroken royal line. The primary approach among commentators is that this pledge ensures a continuous government and kingship [רש״י, רלב״ג, ביאור שטיינזלץ, חומת אנך]. Alternatively, others understand this promise as a symbol of light, representing a king who illuminates the way for his people just like a guiding lamp [מצודת ציון, רד״ק]. Ultimately, this guarantee of continuous leadership was granted to David's descendants to last for the entire duration of the kingdom's existence [מצודת דוד].