Brazil is over four times as large as any other nation in South America. Is this proportion due mostly to slavery? Or were there immigration or indigenous factors that lead to such a disproportionately large share of South America's population?
I suggest considering some factors to put this question in a bit of context. Brazil certainly has a larger population than any other country in South America, but it is also significantly bigger than any other country. We might compare population density (people per square mile) rather than overall population. A quick search of the internets says that Brazil's population density is around 61 per square mile. That's significantly more than, say, Argentina's (37 per square mile), but on par with Venezuela (77 per square mile, so actually a touch less) and significantly less than Ecuador (152 per square mile). Thinking about this is probably a bit more complicated than that. Brazil also has large tracts of land that are sparsely inhabited, as much of the Amazon is, so maybe a more meaningful comparison would be population density of all land not counting park space. But, again, many South American countries have sparsely inhabited forest, so it's unclear to me that that measure would suggest Brazil is more populous.
Anyways, all this is to suggest that there may be a perfectly mundane explanation: Brazil has a larger population because it's a larger country. Maybe the deeper question would be to ask why it has a larger landmass. Why were Spanish territories split into different colonies/states, while the former Portuguese territory is one large country?
To add to other responses here: for many decades in late XIX century and early XX, foreign immigration was heavily encouraged, mostly to compensate the lack of slaves after "importing" Africans was prohibited in 1850 and slavery itself was outlawed in 1888. From the 1880's to the 1930's, Brazil's biggest export was coffee, which needed a lot of hand labor.
This article gives an idea of how many Europeans migrated to Brazil, but there was also a big influx of people from Japan, Middle East, and pretty much all over the world. There was even official government advertisement in foreign countries, specially in Italy. Land owners would even offer to pay for the immigrants' tickets so they'd come.
This other article goes deep into the matter (google-translated from Portuguese, sorry, but it's a pretty good article).
I'm sorry I can't cite better sources (if any) for these claims, but if you want I see if can find them.
Edit: Oh, I remembered another good point about the matter: why not hiring the newly freed black slaves in the farms instead of bringing people from overseas? Well, it was all part of an effort the make the overall Brazilian population "of whiter skin color".