Why did Europe's nations expend so much time and money trying to colonize and exploit new land all the way across the Atlantic ocean when they had the whole of Africa right across the Med? And why did they suddenly change their mind about Africa in the 19th century?
It seems like Africa would have offered the best return on investment for any colonial-minded expeditions using 16th century technology, but instead everyone focused on sailing tiny, barely-seaworthy ships across the open ocean for months at a time.
What context am I missing, here? Why not Africa?
Firstly, there were a few colonies established along the shores of Africa in the XVI century by Portugual (Angola, Mozambique) and later Holland (Cape Town); you are correct, though, that the majority of colonisation only came in the XIX.
In the XVI, there still existed powerful Negro states able to hold their own; Songhay in West Africa is the first example to come to mind, along with the Congo states. Africa was also protected by the mosquito bearing various tropical diseases, most notably malaria; until the mid-XIX century, Africa had the eponym of white man's grave. Much of the interior of Africa was uncharted and laced with thick jungles and twisting rivers, dangerous to any outsider. It was not until the middle XIX that suitable medicines and means of transport were devised to reach into the centre of the continent.
There already were trade networks established that reached far into the African continent, and at times even with large empire to back them up. For example in West Africa, the Songhai or Mali empire, famously gold-rich. The combination of a solid resistance with the opportunity to trade for African goods at the coasts, delivered by local trade networks (including slaves), made it unattractive to spend more resources to obtain political control of the area when comparing the cost/benefit ratio with the opportunities in the Americas.