They were seeking greater economic opportunity, while some, such as the pilgrims in 1600s looking for freedom.
They came because of Rinderpest. Before coming to South America, Africans in Africa depended on cattle such as cows to thrive. But Rinderpest brought to Africa by foriegners began to spread, and the cattle started to suffered from fevers, inflammation in the brain and dysentery. They also had major problems with Europeans and their industries. So they decided to settle in South America.
Hope this helps :)