Historically, only those who were converted to Islam were allowed to rule or even to engage in any ind of comercial trading, showing how religion affected a society's prosperity.
Regarding location, areas that were located near trade routes where a lot of traders passed could prosper either by taxation or by developing trading.
Finally, natural resources were the main source of wealth for African societies, specially around the 14th century. A civilization with plenty access to gold would consequently posses higher wealth.