Portugal and Spain were, in some ways, natural rivals because of geography. The two countries are neighbors on the Iberian Peninsula, and neighboring countries have long had rivalries and conflicts in many parts of the world. It was no different with Portugal and Spain (though we should note that the rivalry began before there was any unified country of Spain).
The natural rivalry between Spain and Portugal was exacerbated by trade. Both countries were very interested in exploring and developing trade. They were both located in ideal places to start exploring Africa and to start thinking about trying to round Africa and find a way to the Spice Islands in Asia. Because of this, they came to be rivals in exploration. They competed with one another to “find” and to claim “new” lands. This rivalry became heated enough that the two countries had to get the pope to divide up the New World into parts that would be Spanish and parts that would be Portuguese. The line that was drawn in the Treaty of Tordesillas did this, leading to the situation where Brazil was Portuguese while the rest of South America belonged to Spain.
The rivalry between Spain and Portugal during this period was basically centered on territorial and economic supremacy. The two powers were engaged in rigorous efforts to discover new lands and routes of trade so as to expand their stakes. The spice trade was very lucrative at the time and the two took keen interest in it and expeditions were even sponsored to establish a route to the Spice Islands in Asia. Each side wanted to gain advantage over the other in the much coveted spice trade. However, Portugal’s interest and efforts to get to the Spice Islands started long before Spain’s and so once Portugal learned of Spain’s interests, they had the Pope declare a demarcation to separate the two sides’ territorial claims. Unfortunately, this demarcation left Spain disgruntled as they had been locked out in terms of access to the Spice Islands.
One year after the Pope’s declaration, the two signed the treaty of Tordesillas that gave Spain an entry point to Asia. In summary, during the 15th century, Spain and Portugal were engaged in conflicts because of their quests to expand their territories and discover trade routes which would bring them economic prosperity.