ancient Ghana and ancient Mali. Improved answer: that's not true. ancient Ghana and ancient Mali were kingdoms before Songhai. mostly North Africa traded with Songhai to get salt and gold. i believe this is true.
In the 1300s Songhai had become so rich and powerful to draw attention of the rulers of Mali. Then, they sent an army to conquer Songhai. Later, as the Empire of Mali became weaker, they rose up against them, and won their freedom.
The Empire of Mali lasted from the thirteenth to the late fifteenth centuries. The great leader was Mansa Musa. However, his sons were unable to hold the kingdom together after his death. A result, Mali was taken over by the Songhai Empire.