Despite the severe sins committed by Jehoram and his household, which made them fully deserving of punishment and complete destruction, God chose to spare the royal dynasty [מצודת דוד, ביאור שטיינזלץ]. God simply did not desire to wipe out the house of David [מצודת ציון, ביאור שטיינזלץ]. The survival of this royal line did not stem from any good deeds or merits held by the current generation. Instead, the dynasty was preserved entirely because of the historic covenant God had established with David [ביאור שטיינזלץ].
Central to this covenant was a divine promise to grant David an enduring legacy. The primary approach among commentators [מצודת דוד, רלב״ג, רד״ק, ביאור שטיינזלץ] understands this promised legacy as a continuous, unbroken dynasty symbolized by a lamp. Just as a lamp casts light on its surroundings, a king guides and influences his people. God promised that David's lamp would never be extinguished, ensuring that a descendant of His chosen king would always sit on the throne. Taking a different perspective, [רש״י] understands this enduring legacy as a yoke rather than a lamp. In this view, the promise refers directly to the yoke of kingship and the lasting authority granted to David and his descendants to rule over the people of Israel.