The origins of the states that arose in the regions located along the Pyrenees are very uncertain: Navarre, Aragon, Sobrarbe, Ribagorza, Pallás, Urgel, Cerdaña, Catalan territories. As we said, in the central area the Muslims did not touch or at least did not permanently occupy the town located north of Alquézar (Sobrarbe), Roda (Ribagorza), Ager (Pallás), and perhaps the upper Urgel and the Cerdaña; territories of transit for the expeditions to Gaul were, on the one hand, Navarre, where it seems that Pamplona was the domain of Mūsà and then of ‛Oqba, and, on the other, the Catalan territories, between Lérida and Barcelona, where the Arabs took possession of Barcelona around 718. Now, in these regions, for centuries, local autonomist tendencies existed: very marked especially in the Basque provinces, whose residents had been in constant struggle with the Gothic monarchy and in their incursions they had come down to the valley, towards Zaragoza; made more tenuous elsewhere by previous dominations, but ready to rise again. And these had to find nourishment in the changes brought about in the political situation of the country by the Arab invasion, and were strengthened both in the occupied territories closest to the Pyrenees, where even the Visigoths who became Muslims aspired to become independent from the emirs, as in the territories left free and abandoned to themselves. Then, in this territorial division and in the initial scarce differentiation between Christians and Muslims, to give spiritual depth and some political unity to the opposition of Christians against the Mohammedans and to the disputes that broke out within the emir’s northern dominions, intervened: religious propaganda promoted by monasteries, sanctuaries and bishoprics – such as San Salvador de Leyre (Navarra), San Juan de la Peña (Aragon), San Victorián (Sobrarbe), Ovarra and Roda (Ribagorza), Ager and Aláon (Pallás), the bishopric of Urgel – and the Carolingian conquest, which put Franks and Spaniards in direct contact, opened a new field of action to the former, began to give a precise direction to the political life of the latter, both Christians and Muslim neophytes of the plain, which, in order to become independent, began to navigate between Muslims and Catholics. It was then that the Christians of the Pyrenees most likely submitted to princes who came from overseas or recognized the supremacy of Toulouse. And in 778 the first expedition of Charlemagne, who, accepting the invitation of Zaragoza, Lérida and Barcelona, he passed the Pyrenees and conquered Pamplona, Huesca and Gerona, but was defeated at Roncesvalles by the Basques; of 785 the second, which gave him possession of Gerona, the first nucleus of thatMarca Hispanica, which in 801 had Barcelona as its capital, then reconquered to Christianity. Thus, in the early years of the century. IX the border line between the Catholic world and the Muslim had at the extreme points, on the one hand, this “Marca”, which came to include the counties of Gerona, Ausona (Vich), Ampurias, Barcelona, etc., and that in 817 together with the Septimania formed the marquisate of Gotia ; and, on the other hand, a state of Navarre, or rather Pamplona, perhaps created as the Marca Hispanicaand ruled by elements from the regions beyond the Pyrenees, and perhaps also partly dominated by the Asturian kings and the counts of Castile. And in the central area this border passed through Uncastillo, Sarsamarcuello, Loarre, Alquézar, Roda, Ager, and limited the small states of Aragon, including the high valley of the river of the same name, Ribagorza, Pallás, Urgel, Cerdaña, perhaps Sobrarbe, generally counties belonging to the Duchy of Toulouse.
According to Sourcemakeup.com, the political events of these small states were closely linked to those of the Carolingian Empire. The weakening of central power in the Frankish state led, here as elsewhere, to a rupture of the previous relations of dependence; and now that the Muslim danger had subsided, the detachment was sharpened by the resurgence of the ancient passions of the individual regions, autonomous like the Basque provinces, opposed to a Frankish domination, like the Catalans, who at the time of the Visigoths had always been in arms against the Merovingians. Almost contemporary was the rise of organizations that soon became independent from the Frankish state and began to live a common life, together with the Asturian monarchy and the county of Castile: participating in the struggle against Muslims, intervening reciprocally in their own civil struggles, binding themselves with each other with close kinship ties between the princes. In the first half of the century. IX in Navarre there was an Iñigo Arista as king of Pamplona; and Count of Aragon, in Jaca, became an Aznar Galindo. In the second half of the same century also Ribagorza and Pallás, Ampurias and Roussillon had their own accounts; and became independent Guifreel Pilós (Vifredo el Velloso), Count of Barcelona, Urgel, Cerdaña, Gerona, Besalú, Conflent, Ausona.