Delivering a harsh message to the royal court is a dangerous act, and Urijah's prophecy provokes intense anger that quickly escalates into a direct threat to his life. King Jehoiakim actively seeks to execute the prophet. This extreme reaction stems from the king's absolute refusal to believe that Urijah's words are a genuine prophecy from God [מצודת דוד].
Word of the danger soon reaches Urijah. Upon discovering the king's intention to have him put to death, he realizes he must escape immediately [מצודת דוד]. Fearing for his life, he chooses to flee beyond the borders of Judah. He specifically travels to Egypt because that land lies completely outside the king's jurisdiction and control, offering a safe haven from royal authority [ביאור שטיינזלץ].