Mentioning previous answers should not discourage more questions, information, or debate.
/u/AD1337 wrote a reply to "Brazil is a huge country. One could easily imagine that over the course of time it would have splintered into 2, 3, or five different countries. What has kept it together?" at https://www.reddit.com/r/AskHistorians/comments/7rr30o/brazil_is_a_huge_country_one_could_easily_imagine/ . They pointed out that there were a couple of attempts to split, but the revolts were ended.
As for Spanish America, you can see /u/yodatsracist answering under "Why did North America split into 3 countries and South America split into 15 though they were colonized similarly?" at https://www.reddit.com/r/AskHistorians/comments/2doi5s/why_did_north_america_split_into_3_countries_and/ (with some bonus notes on North America).
There's also "Why did the Portuguese colonies in South America evolve into a single country (Brazil) whereas the continent's Spanish colonies broke off into nearly a dozen countries?" at https://www.reddit.com/r/AskHistorians/comments/3duadi/why_did_the_portuguese_colonies_in_south_america/ . It's a mismash of different comments, mostly on Portugal and Brazil, some Spanish, a little North America, by too many people to credit.