One major factor was tropical diseases. Europe is a relatively cold place where rainforests cannot thrive. As a result, the inhabitants of Europe never had to deal with the deadly diseases that thrive in tropical latitudes, and as a consequence never developed any resistance or immunity to them either.
So when Europeans began exploring the shores of Africa, they mostly encountered a tropical environment that proved rather risky to them, and combined with the lack of a positive reason to actively colonize these shores, Europeans did not permanently settle in Africa for a long time.
Well, actually, that is not true. Europeans did in fact colonize a part of Africa fairly early - South Africa. And you know why they colonized South Africa? This map shows why. The climate in South Africa is very similar to that of Europe.
Tropical diseases are also one of the main reasons why the transatlantic slave trade developed the way it did. Europeans began colonizing the Americas in the tropical regions of the Americas, and they soon realized that this environment was rather hostile to them. So with Europeans themselves at risk, and with Native Americans succumbing to Eurasian diseases, Europeans began importing slaves from elsewhere to fill the lack of labor forces available to them. And Africans became this source of slaves because many of them lived in the tropical regions of Africa, and had as a result developed resistances to tropical diseases. This made them the perfect choice for labor in American tropical regions.