I know very little about Spanish and Portugese history, so forgive me if I make some factual errors here. Looking at maps from about 1500 onward, it seems the entities that we know as Spain and Portugal have essentially kept their current borders to the present day, right after the expulsion of the Moors and the end of Muslim influence over the Iberian peninsula.
Why is this? Was there something inherently more stable about Iberia than the rest of the European continent? Did geography play a role?
It wasn't entirely static. The Iberian Union as a result of the Habsburgs consisted of Spain and Portugal from 1580-1640. In the end while both were rivals, both were also Catholic nations with a lot to lose by going to war at home. Instead their conflict was overseas from de Gama which begot Columbus to the Treaty of Tordesillas which defined separate spheres of influence.