As with much of the less-developed world, the borders of modern-day Brazil are the product of the political machinations of European colonial powers, in this case the Spanish and Portuguese of the late-15th century. Both Spain and Portugal were avid colonizers of the western hemisphere, and frequent competitors for prime real estate. Both imperial powers reached South America during the same period, and both sought to secure the land and resources of South America. Rather than go to war over the territory that would become Brazil, however, they amicably negotiated a resolution of their competing interests at a conference in the Spanish town of Tordesillas in 1494. It was at this conference that, as later French and British diplomats would do in the Middle East with respect to today's borders in that region, the Spanish and Portuguese agreed upon a division of this region of South America that left the Portuguese in control of a vast tract of land east of the Amazon River. Following Brazil's independence from Portuguese rule, which occurred in 1822, the territory's new ruler, Pedro I, unified the now-former Portuguese territory, that had been ruled by Pedro's father, Joao VI, as a kingdom. The latter had established the kingdom after fleeing his native Portugal to escape the French armies of Napolean, who had invaded the Iberian Peninsula. Once independent of Portugal, Dom Pedro established Brazil as a constitutional monarchy.
In conclusion, Brazil's huge expanse is a direct consequence of Portugal's good fortune in securing that territory from encroachment from Spain during the late-15th century. Portuguese remains the dominant language of Brazil, in contrast to the rest of South and Central America, where the Spanish colonial influence continues to be felt.