IIRC The Treaty of Tordesillas originally divided SA in Spanish side and Portuguese side, the portuguese side being significantly smaller
Why the 'spanish' (Spanish influenced countries) side, otherwise bigger, turned being the thin west side of the continent today, and the portuguese side (nowadays, Brazil) ended being so huge?
The phrasing of your question is a bit confusing, but I'll try to address it while staying focused on Tordesillas.
1-The treaty was made in 1494. You'll note this is a period when Europeans of all kinds have only the haziest notion of what is available in the Americas (Pedro Cabral would not "discover" Brazil until 1500). The treaty was designed to replace an earlier pro-Spanish statement from the pope that had granted the Spanish essentially a blank check for "Catholic" conquests, which was all part of the complicated back and forth around the potential value of Columbus' discoveries (to which the Portuguese had a claim) and the much more obvious and present value of what Portugal was working on in circumnavigating Africa to Asia. At this point, Spain and Portugal are negotiating as relative equals who don't want a real fight; this is not the first time in this conversation that size of a country on a map will mislead you.
2-The treaty was adjusted when Cabral "discovered" the tip of Brazil, but again, this was not terribly valuable at the time. Throughout the 16th century, the Portuguese would move around that line, mostly dictated by the difficulty of navigating the Brazilian coast (sailboats are bound by winds and currents and have trouble following the coast but do well simply crossing back and forth between Iberia/Africa and Brazil) and the fact that the first big economic opportunity was chasing the isolated stands of Brazilwood. No one was terribly bothered about respecting the lines; here again the map (and Mercator projections doubly so) misleads you, because in the eyes of the Spanish Peru and Mexico were worth far, far more valuable with their preexisting empires to loot and exploit than Brazil.
3-The latter half of the 16th century gets even more complicated as the Spanish king was briefly the king of Portugal as well until the mid-17th. You can imagine what that means for the line, as in 1695 Brazil had its first gold rush prompting a majority Portuguese occupation of territories west of the post-Cabral line. The Spanish and Portuguese groups had a good amount of conflict, especially subsequent to Portugal becoming independent again. In 1750 the treaty of Madrid sets "natural" boundaries at the Rio de la Plata, where Portugal can keep its gold claims and Spain can halt Portuguese encroachment. The underlying story is that the Portuguese (like other Catholic countries who are about to follow their lead) are at least as concerned about the Jesuits and expelling them from their considerable holdings in Brazil which the Spanish would also do to a lesser extent until later. The Jesuits and Guarani they've been exploiting/protecting in their missions revolt, which makes the treaty unenforceable until the Spanish and Portuguese finally crush the revolts beyond all doubt.
4-Then you have a sequence of lesser known treaties, swapping of the Jesuit Mission-rich areas, and ultimately the Brazil shape we know today is firmed up by 1801. Note how relatively important organized human capital is to these countries, just as it was to Spain with Mexico and Peru beyond the gold and silver. At this point Napoleon is going to become a much bigger and more personal concern for the Spanish and Portuguese monarchs, and the so-called independence/revolution period takes off in Latin America and Europe. Brazil's path to independence is quite different from that of Spanish colonies, but the long and short of it relative to your question is that the arbitrary lines on the map pretty much stopped shifting at this point as they became integrated into "national" identities, as opposed to far more negotiable colonial identities. Apologies to any whose heads explode as a result of that oversimplification.
Summary: size isn't everything, maps are misleading when it comes to the importance of colonies, and the treaty itself was a step in a much bigger series of negotiations, wars, and counter-negotiations. It's not your fault if this is all new to you as abbreviated surveys of Latin American history tend to overemphasize Tordesillas as an easy explanation in and of itself.
Hope that helps.
Since the Tordesillas was based off longitude, it is important to note how longitude is measured on the earth's surface while sailing. First let me begin by saying that latitude measurement at sea, by reckoning of celestial objects, was much easier than longitude determination at sea.
To determine longitude, one needs to measure the time-of-day difference between one location and that of another, usually standardized, reference. This requires a clock with very small drift over time, which wasn't available for a very, very long time. As a result, the longitude of maps are usually not accurate, especially for maps of the new world, since one can't even measure one's relative longitude very accurately at sea. This was the case during the period in question.
If you look at maps produced in that era, you will see significant inconsistencies in longitudinal representations of places.
So in addition to historical context and intent, there was also absolute limitation in one's ability to determine longitude. That's why the Treaty specified the line of demarcation in leagues relative to Cape Verde islands, not in degrees.
For example, see the Cantino Planisphere map and its exaggeration of the shape of Brazil.
The Treaty of Tordesillar was signed in 1494. At that time Portugal and Spain were the main explorers and Portugal was focused on Africa and India.
100 years later it was a very different reality,
In 1640, Portuguese nobles declared independence from the king of Spain and the relations weren't the best.
So the Treaty of Tordesillas didn't went "wrong", it just stop making sense, since the other European countries would not respect it, and the relation between Portugal and Spain was not friendly.
It should be noted that until the Crown Union between Spain and Portugal, portuguese settlements remained mostly on the coast. It wasn't infact until both countries had the same king that the first real drives inland began.