In the days of the Russian empire, Russia’s relations with the Islamic world were very different from the West’s, being defined by Russia’s own imperial expansionist logic. The Kazan khanate was already conquered by Russia by the sixteenth century. With the decline of the Safavid dynasty in Persia in the eighteenth century, Russia was able to easily move in and occupy Azerbaijan, Dagestan, the Kazakh steppe, and finally Turkestan (present-day Uzbekistan, Turkmenistan, Kyrgyzstan and Tajikistan). Crimea was seized from the Ottomans at that time as well. The Caucasus tribes were more resistant, and it was not till the mid-nineteenth century that they were quelled.
Afghanistan became Russia’s southern flank, and British-Russian imperial rivalry there prompted Britain to initiate two wars in attempts to subdue Afghanistan in the nineteenth century to keep Russia at bay, finally allowing the British to control Afghanistan’s foreign affairs. Just to make sure, the British signed a treaty with the Russians on the northern boundary in 1887 (no need to worry about the amir).
Under the influence of British-Russian intrigues, from the 1890s on, both Central Asia and Afghanistan modernized somewhat. Muslims were by then a significant part of the Russian empire, but were treated brutally. When the Russian revolution happened in 1917, even the atheist communists looked good in comparison. And indeed, after a few decades of repression of all religions, the fruits of socialism came to Soviet Muslims and Christians alike, with economic well-being far exceeding that of the Muslim world under the imperialist yoke.