I think I can answer a lot of this question myself.
Geography, of course, played a major role:
- In the south, the Sahara put a powerful brake on the religion's expansion further into Africa. (Ethiopia, a vigorous Christian state in the Horn of Africa, also helped to slow things down.)
- In the west, despite some remarkable early successes, the Islamic world clearly overextended itself by crossing the Straits of Gibraltar into Spain, and were forced back into Africa over several centuries.
On the Islamic world's northern frontier, in Eastern Europe, the geography-driven narrative starts to break down. But this is a story I know very well: despite significant instability, as well as some astonishing moments of political and military stupidity, the rickety Byzantine Empire proved to be a surprisingly tenacious opponent of Islam. And, on the demise of that state in 1453, the Habsburgs and Russians slowed down and, eventually, largely reversed the spread of Islam into Europe.
(Please tell me if you disagree vehemently with the above!)
What I don't understand, however, is why Islam didn't spread any further to the EAST. The Rashidun Caliphate conquered Sassanian Persia with an ease which shocked everyone - not least the Muslims. From there, Islam became the dominant religion, not just in Persia proper, but throughout "Greater Iran": the Caucasus, Afghanistan and Central Asia. But, to date, the Islamic world has been incapable of repeating those kind of successes in the Indian Subcontinent. Military progress was slow: Aurangzeb came close, but never quite succeeded, in subduing all of South Asia. And Muslims have always been a minority amongst the Subcontinent's inhabitants. Why?
I know that Islam was able to bypass - sort of - its failure in India, and the religion spread to Malaysia and Indonesia - mostly through trade, I'm told - where it became dominant. But Muslim merchants must have taken their wares to Thailand, China, etc, too. Why didn't it spread to those nations?