Europeans did, of course, know about North Africa. The Mediterranean had served as the crossroads of the civilized Western World since ancient times, and despite North Africa being ruled by Muslim kingdoms, Europeans regularly traded with Muslim merchants. As noted above, there were many lucrative commodities (like gold and ivory) that Europeans coveted and were only available from North African merchants. Europeans knew that these commodities originated somewhere across the Sahara desert, but were unable to access their sources directly.
During the European middle ages, Sub-Saharan Africa was dominated by various medium-sized kingdoms, most of which had converted to Islam. The largest was that of Mali, which oversaw a lucrative trade in gold and various luxury goods north via caravan to North Africa and the rest of the Mediterranean. Likewise, other kingdoms traded with one another and, via caravans, the Middle East and Europe. These kingdoms also engaged in frequent warfare against one another (just as the states of Europe did).
Drawn by the gold they were able to acquire via merchants in North Africa, Europeans had tried in the late Middle Ages to sail down the west coast of the continent, but their naval technology was insufficient. In the fifteenth century that changed with the introduction of the caravel; the same thing that made it possible for Europeans to reach the Americas allowed them to make reliable journeys along the African coast. Along with new compasses and the astrolabe, Europeans were able to make long-distance trips by the mid-fifteenth century that far exceeded their earlier maximum ranges.
The beginning of the ongoing contact between sub-Saharan Africa and Europe happened under the auspices of Prince Henry the Navigator (1394 – 1460), the governor of the southernmost province of Portugal. He sponsored numerous Portuguese expeditions along the west coast of Africa, hoping to somehow seize lands or at least find routes to lucrative sources of gold and spices. In 1497, Vasco Da Gama, a Portuguese nobleman, was sponsored by the Portuguese crown and sailed around Africa and as far as India, in the process claiming various territories for Portugal. In the sixteenth century, the Portuguese maintained a lucrative monopoly on trade between Europe and West African kingdoms, East African kingdoms, and Indian merchants. This amounted to a royally-controlled, militarily-enforced monopoly of waterborne trade between Europe and India and Africa that lasted well into the sixteenth century. Thus, tiny Portugal was, for a time, one of the wealthiest states in Europe.
It should be emphasized that this Portuguese “monopoly” was first and foremost a monopoly between the Indian Ocean trade and Europe, not a monopoly of trade within the Indian Ocean itself (despite the best efforts of the Portuguese). Indian, African, and Middle Eastern merchants continued to exchange goods and wealth whose value greatly exceeded that of the trade between Europe and the Indian Ocean region. What changed, however, was that Europeans were for the first time able to directly access the sources of luxury commodities like spices, indigo, ivory, and gold, and Portugal was in the forefront of the European states that sought to reach those sources. Other states were quick to follow once the sheer extent of African and Indian wealth was revealed through Portuguese trade, and soon first the Dutch and then the English started taking over the oceanic trade routes from the Portuguese.