When a nation faces impending ruin, a prophet's prayer can alter the course of events. Following a heartfelt plea for mercy, God responds to the prophet's request and steps back from His intention to bring disaster. His choice to relent happens because He listens to the prophet's prayer for a second time [אבן עזרא].
This act of forgiveness directly mirrors a previous vision. Just as He did before, God ensures that this harsh decree is completely canceled and will not be carried out [מצודת דוד, ביאור שטיינזלץ].