From the time of the Canaanite enslavement in Egypt in the 1900s BCE the end of the First Temple—a period of 1400 years—Hebrew was written in the Canaanite script that was common to all Canaanite peoples. During their three generations of exile in Babylon, the Judean upper classes were exposed to the Assyrian/Aramaic script, which was inspired by the Canaanite script but had evolved, under centuries of Mesopotamian scribes, into a more disciplined set of forms designed around a squarish template (rather like).
This impressed them a great deal—so much so, that when they returned to Judea under the Persian kings Cyrus and Darius, they preferred to use the Assyrian script rather than the original Hebrew/Canaanite one for the monumental task of committing the biblical canon to writing. The Assyrian script thus acquired a semi-sacred status, that ensured its preservation, regardless. Thus, text from around the start of the Common Era is decipherable both by a Persian of 500 BCE and a modern-day Israeli:
The Arabic script, on the other hand, is a derivative of the script of the Nabateans, which also derived from the Assyrian/Aramaic. Because the Nabateans used it purely for the functional purpose of recording trade transactions and other administrative tasks, the original Assyrian letter forms were never regarded with particular reverence, and so naturally morphed into something practical and cursive over time:
This trend continued under the Arabs once they adopted the script for their own purposes. Once they used it to record the Qur’an, that cursive acquired the same sacred status as the Square Script had for Hebrew—which is why it has been preserved since then.
(Originally written in reply to a question at Quora.com).