The disintegration of the Caliphate of Cordoba into taifas resulted in a loss of Muslim military power. The Christian kingdoms took advantage of this weakness to extend their territories.
In order to grant peace, the Muslim kings payed tributes (gold and other treasures ) to the Christian kingdoms. These tributes were called parias. Christian Kingdoms used these treasures to increase their military power.
THE CONQUEST OF THE TAGUS AND EBRO VALLEYS
The first king of Castile , Ferdinand I, gained control of the Kingdom of Leon and conquered Coimbra. He also repopulated the southern Duero valley. His son, Alfonso VI, conquered Toledo and extended the territory beyond the river Tagus.
The occupation of the Ebro valley began when Alfonso I (the Battler) conquered the Muslim taifa of Zaragoza. Alfonso II dominated all Aragón founding cities such as Teruel.
On the other hand, Ramón Berenguer IV, count of Barcelona, conquered Tortosa and Lleida.
THE ALMORAVIDS AND THE ALMOHADS
To defend themselves against the advance of the Christians, the Muslims asked the Almoravid Empire in the north of Africa for miitatary help.
At the end of the 11th century, the Almoravid armies defeated the Christians and took back part of the territories conquered by the Christian kings.
Around 1140 the power of the Almoravids weakened. So Muslims called the Almohads from the North of Africa to fight against the Christian kingdoms.