Okay, so pastoral North Africans called Berbers had long traded with West Africans, with the Berbers offering salt in exchange for West African gold. That may seem like a bad deal until you consider that without salt, we die, whereas without gold, we only have to face the universe's depraved indifference to us without the benefit of metallic adornment. That went to an ominous place pretty quickly, right? So anyway, the Berbers were early converts to Islam, and Islam spread along those pre-existing trade routes between North and West Africa. So the first converts in Mali were traders, who benefited from having a religious as well as a commercial connection to their trading partners in the North and the rest of the Mediterranean. And then the kings followed the traders, maybe because sharing the religion of more established kingdoms in the North and the East would give them prestige, not to mention access to scholars and administrators who could help them cement their power. So Islam became the religion of the elites in West Africa, which meant that Muslim kings were trying to extend their power over largely non-Muslim populations, which worshipped traditional African gods and spirits.