The mountains of the Iberian Peninsula are islands of habitat that were once much commoner and joined together. This was during the long periods when global temperatures were cooler than today, tens of thousands of years ago. Then, many birds typical of Central and Northern Europe spread south at the expense of Mediterranean species. Only in the deep south were the warmth-loving species able to hang on until the melt returned. As this happened the northern species were pegged back but some remained in cool habitat islands in the mountains. They became isolated from each other, differentiating genetically or becoming extinct. Birds like the Ortolan Bunting (above and below) are species that breed in Central and Northern Europe but which retain outliers as far south as the Sierra Nevada.
These buntings are trans-Saharan migrants. They cope with the inhospitable winters, even today, by migrating to tropical Africa for the winter. We started to see them returning last month here in Gibraltar and now they are established on upland territories where they make the most of the spring boom of insects in the alpine pastures. The migratory strategy undoubtedly helped them survive the harsh periods of the Ice Ages.