West Africa had access to an abundance of gold but had almost no salt. On the other hand North Africa had lots and lots of salt. Once they found out about each other trade for gold and salt was booming.
Although it might seem weird to us that they were trading gold for salt it made sense because everyone needs salt to live. Then because of how much trade was going on Mansa Musa became the richest man of his time with all of the gold he was getting from the salt trade.