It is worth noting that the ten-cohort legions of the Principate were long abandoned by the time of the Arab Invasions of the seventh century. During the third century, the Roman military undergoes a period of transformation which results in the ten-cohort legion being phased out in favor of smaller regiments (along with many other changes). This is not as radical as it might seem, as the deployment of legionary detachments (known as vexillationes) for a wide range of tasks was common throughout the Principate, as a full legion is a large, unwieldy formation, unsuitable to singular deployment outside of large campaigns.
While we wait for a Byzantinist proper to comment on the development of the themes (paging /u/shlin28), there are several points I feel need to be mentioned. The Roman army, in both the Principate and in Late Antiquity, was an inordinately expensive institution. Although the precise sum is unclear, it is estimated that, during the fourth century, upwards of fifty to seventy percent of annual state revenue went toward maintaining the army. Thus, the existence of an effective army was predicated on the Roman state extracting tax revenue from the territories it controlled, with wealthy areas naturally providing higher returns. With the loss of the West and the wars of Justinian and his successors, it is evident that the resources of the East were increasingly strained, such that Heraclius was only able to raise an army to eject the Sassanids with great financial difficulty (and funds from the church). The Arab Invasions further hamstrung the Empire financially, as the Arabs now controlled Egypt and Syria, long some of the Empire’s wealthiest provinces. The military system of Late Antiquity, already strained, could no longer be supported, as the Roman state simply lacked the revenue to maintain a large professional army. While the institution of the theme system (which did not happen immediatly but rather developed over a period of several decades, if not longer) was certainly done with other practical considerations in mind (such as the need to defend Anatolia, now the heartland of the Empire, from annual Arab raids), reforms to the military system were necessary regardless, as the funds were no longer present to maintain a standing army of any real size.