Moors

The Moors (comes from the Mauri tribe name) were a term that referred to Spanish Muslims, but also is used to refer to any type of Muslim, like "Saracens". The Moorish kingdoms included Al-Andalus, the Almoravids, and Almohads.

Background
Moors originated in Mauritania, in northern Africa. The Moors were a tribal people, little more than Barbarians, who became Muslim due to Islamic impact on the Middle East and north Africa. The Moorish people evolved from total barbarians to a high-classed society, who were as chivalrous as the Christian kings of Spain, and were respected enemies of King Alfonso, who even managed to have trade rights for them in the 1080s up to the early 1100s. However, they fought at the Battle of Sagrajas, which was a Moorish victory, and the Moors quickly established hegemony over southern Spain and North Africa.

Reconquista
Alfonso the Crusader and the King of Portugal Garcia II formed an alliance by marrying Rodrigo, Prince of Castile to Maria el Valiente of Portugal, a young princess. Portugal invaded the Moorish Kingdom and conquered Cordoba, so Alfonso decided that he wanted to grab as much of Spain as he could before Garcia took it all over for Portugal. Alfonso took Granada and several other cities and participated in the Crusade of 1103 that captured Antioch, but only led to a series of rebellions in Antioch and Aleppo, both of which were conquered and re-conquered by Christian forces after repeated civil rebellions, with Acre and Jerusalem later experiencing that as well.

The Moors won several battles and lost many, and their finest hour at the Battle of Alarcos was almost immediately followed by a crushing blow at the Battle of Los Navas de Tolosa, which was the decisive battle of the Reconquista. However, Moor resistance only ended in 1492 with the capture of Granada, and they were either expelled along with Jews, heretics, and pagans, or were baptised as "Moriscos".

Moorish Kingdoms
The "Moorish" nation's definition was replaced many times during the turbulent period that was the Reconquista, with the collapse of a Muslim dynasty taking place every hundred years or so. Al-Andalus was taken over by the Almoravids, who were then invaded by the Almohads, who, in turn, were conquered by the Emirate of Granada and smaller Moor factions like the Wattasids and Zayyanids. There was no one "Moor" kingdom, but many small ones.