The spread of Buddhism and the spread of Islam have in common the fact that both were spread to some degree by trade and to some degree by conquest. The major difference between the two is that Buddhism relied much more on trade and Islam relied (particularly at first) on conquest.
The main initial spread of Islam was accomplished by conquest. It was in this way that Islam spread out of Arabia, through the Middle East, and into North Africa. After gaining its major bases through conquest, it spread via trade to other parts of Africa and to places like Indonesia.
By contrast, Buddhism was spread much more by trade. The faith was spread to some extent by conquests like those of Asoka and the Mauryan Empire. However, much more of the spread of Buddhism was due to people being exposed to the ideas of Buddhism through trade routes.
Buddhism spread from India by peaceful means. Buddhist monks traveled to other lands, but in spreading their religion, they allowed people to retain some of their older beliefs in a process called syncretism. Instead of being forced to convert, people turned to Buddhism to relieve some of their own suffering and to find meaning in their lives. The religion was spread into Asia in part by trade along the Silk Road. Slowly, populations along the trade route adopted elements of Buddhism that they applied to their lives.
Often, Buddhism was adopted and spread by monarchs. For example, King Ashoka, an Indian emperor during the Maurya Empire who ruled from approximately 268 to 232 BCE, converted to Buddhism after fighting a deadly war with the state of Kalinga. He converted to follow a path of non-violence, and he began to spread Buddhist ideas throughout Asia. Buddhism was also a means of building political ties between different parts of the empire. Later rulers such as the Mongol emperor Altan Khan in the 16th century established Buddhism as the state religion as a way to consolidate power in their empires, but he often resorted to non-Buddhist techniques in his attempt to unify his empire.
Unlike Buddhism, Islam spread in part through military conquest. After Mohammed's death in 632 CE, Muslim armies carried out attacks on the Byzantine and other surrounding empires. Muslims generally left the social organization of the people they conquered in place, and, like Buddhists, allowed the population to convert gradually to their religion. People converted in part to be free from paying a tax, and they, like converts to Buddhism, were allowed to practice in syncretistic way that combined elements of their new and old cultures and faiths. Conversion allowed formerly unorganized pastoral people in Africa, Asia, and other areas to be part of an organized empire. Like Buddhism, Islam began to be spread through trade into the Sahara, up the Nile River, and across the Red Sea.
Like Buddhism, Islam was spread through the conversion of monarchs such as Mansa Musa, the ruler of the Mali Empire (1280-1337 CE). He made a pilgrimage to Mecca and sought to spread Islam through his empire by constructing mosques and madrasas, or schools. His schools became centers of learning in the Muslim world and helped spread the religion of Islam.