How did the king of Ghana become wealthy?

The King of Ghana became wealthy through controlling and taxing the trans-Saharan trade routes that passed through his kingdom. The trade routes transported gold, salt, ivory, and slaves, which the King of Ghana taxed heavily. Additionally, the king had control over the production of gold in his kingdom, which also added to his wealth. The access to such valuable resources allowed the King of Ghana to build a powerful army and establish diplomatic relations with other African and Islamic states.