Islam didn't spread by the sword; the Arabs did.
Pre-Islamic Arabia, like much of the rest of the pre-modern world, was a place of continual low-intensity warfare. (So was Europe, which is why castles and fortifications litter the continent's landscape, and why Shakespeare's historical plays almost always feature violent conflicts and intrigue.)
But when Muhammad came along and when, in response to his preaching, people from various Arabian tribes began to join the Islamic community, he told them that they could no longer pillage and murder one another. They were now, in effect, members of a single faith-based super-tribe.
So their traditional urge to raid — again, not much different than that of every other tribe and petty kingdom worldwide — had to be turned outward. Which it was, and with great success. The Sassanid Persian Empire, one of the two great powers of the seventh century Middle East, fell under Arab control not many years after the Prophet's death, and much of the rest of the Middle East, along with North Africa and Spain, fell to the Arabs within the next few decades.
So, were the Arabs' defeated subjects compelled to accept Islam? Was the ultimatum really "Convert or die?"
No. In fact, for the first two centuries or so, conversions to Islam were often actually discouraged. In Egypt, which seems to be roughly typical, fully three centuries were required before Muslims constituted a bare majority of the population.
Why would the Arab overlords of the Middle East discourage conversions to their Islamic faith? The answer lies within the politics of the Arab empire itself.
After Muhammad's relatively sudden death in 632 AD, his immediate successors, known as the four "orthodox caliphs," were chosen from among the ranks of his earliest disciples. But then, in 661 AD, a new dynasty called the Umayyads took power, based in Damascus.
The Umayyads were descendants of Muhammad's archenemies in Mecca. Mu'awiyah, the first Umayyad ruler, was the son of Abu Sufyan, who had led armies in battle against the Prophet and the Muslims.
When Muhammad defeated Mecca, though, the Umayyad clan converted to Islam. But the depth of their conviction has always been questionable. (Complicating the matter considerably, most of the chronicles about the Umayyads were written by historians under the dynasty that later overthrew them, the 'Abbasids. Those historians thus had an obvious interest in making the Umayyads look bad.)
Non-Muslims were required by Islamic law to pay a tax called the "jizya," in exchange for which they were permitted to continue practicing their faith while enjoying some degree of self-rule, to be entitled to the Muslim state's protection from outside aggression, and to be exempted from both military service and the charitable taxes imposed upon Muslims. Thus, the ultimatum actually given by Arab conquerors was "Convert, or die, or pay the jizya tax."
The earliest Arab Muslims appear, in many cases, to have understood Islam as a religion specifically geared to Arabs, so there was little initial missionary effort among non-Arabs. Moreover, the Umayyads seem to have preferred to continue to collect the jizya tax rather than to preside over a mass conversion of foreigners.
In other words, ironically, the image that many have of Islam expanding at the point of a sword is quite the opposite of the historical truth, which is that early Islamic authorities actually tried to discourage and prevent conversions, and sometimes even pretended that no conversion had taken place when, in fact, it had.
Dissatisfaction with the Arabocentric rule of the Umayyads appears to have been a major factor in the 'Abbasid revolution that swept them from power in 750 AD. The revolt began in the largely non-Arab eastern provinces of the empire, in Iran and Khurasan, and quickly gained momentum among subjects who wanted to be treated as the equals of their Arab neighbors.
And, indeed, they were treated equally. The caliphs of the new 'Abbasid regime, who had promised to treat all subject peoples the same, were absolute monarchs, distant autocrats, in a way that the Umayyads could only have fantasized about. Their subjects were, yes, all equal — equally nothing — before them. (Then as now, those hoping for change from a new political leader should carefully scrutinize his election promises.)
Islam didn't spread by the sword; the Arabs did. Both Muslims and Westerners can and should reflect on that fact.