What factors led to the development of trade between North Africa and West Africa during the pre-colonial period?

What factors led to the development of trade between North Africa and West Africa during the pre-colonial period?