Ramon Berenguer IV agreed to marry Peronella of Aragon, the one-year-old daughter of Ramiro II, and so became Prince Regent of Aragon and Ramiro was able to retire to a monastery.
The marriage, which finally took place in 1151, led to their eldest son Ramon becoming the first King of the united Crown of Aragon in 1162 as Alfons the Chaste.
The Count of Barcelona was considered primus inter pares or "first among equals" amongst the Catalan Counts and as Ramon Berenguer IV was Prince Regent, the Catalan Counties began to be known as the Principality of Catalonia.
However, Catalonia was still a collection of separate counties and would only cohese into a unified entity over the coming centuries.
In order to understand how this happened, it makes sense to look at the major Catalan Counties of Rosselló, Pallars Jussà, Empúries and Urgell and how their relationship with the Counts of Barcelona changed over the century.
The map below shows the Catalan Counties and the Kingdom of Aragon throughout the 12th century and the map at the bottom of the page shows the Catalan Counties a century or so earlier and will help you grasp how the territory developed over the period.
The hegemony of the House of Barcelona over the other Catalan bloodlines re-established by Ramon Berenguer III (1097-1131) and reaffirmed by Ramon Berenguer IV (1131-1162) was extended by Alfons the Chaste (1162-1196) and Pere I the Catholic (1196-1213).
The policies century led to the annexation of Rosselló in 1172 and Pallars Jussà in 1192 and the incorporation of the other Catalan counties of Empúries, Pallars Sobirà and Urgell under the aegis of the Counts of Barcelona.
In Rosselló, the reign of Gausfred III (1113-1164) was a turbulent period due to attacks by Saracen pirates as well as bad relations with Ponç Hug I of Empúries (1116-1154), who had pretentions on his territory. For this reason, he sided with Ramon Berenguer III in the conflict between Barcelona and Empúries in 1128. Then after a brief period of peace Gausfred and Ponç Hug went to war over Requesens.
The political crisis in Rosselló worsened when Girard led a revolt against his father Gausfred III, who managed to retain power with help from Hug III d'Empúries (1154-1175) who was more interested in maintaining good relations with Rosselló than his father had been. In 1162, Gausfred made peace with his son and made him Lord of Perpignan and recognised him as his legitimate heir.
Girard II de Rosselló (1164-1172), ill, without children and under pressure from his subjects made Alfons the Chaste his heir. The other pretender was Hug III of Empúries, who also belonged to the bloodline of the combined countship of Empúries-Rosselló of the 9th and 10th centuries under Sunyer II (862-915), Gausbert (915-931) and Gausfred I (931-991), who separated his possessions between his two sons Hug I of Empúries (991-1040) and Guislabert I of Rosselló (991-1014).
Alfons the Chaste came to the throne of Rosselló in 1162 after the death of Girard II and in 1173 called the Rosselló nobles together to establish the Treaties of Peace and Truce throughout the whole County of Rosselló and the Diocese of Elna.
In Pallars Jussà, Count Arnau Mir (1124-1174) in the times of Alifonso the Battler had moved close to Aragon and after the retirement of Ramiro II in 1137, he became a faithful ally of Ramon Berenguer IV. He participated in expeditions against Almeria, Lleida and Tortosa and Alfons the Chaste rewarded him with the city of Fraga.
His short-lived son and heir of Arnau Mir, Ramon V (1174-1177) left his only daughter, Valença, under the tutelage of Alfons the Chaste. Valença died without heir and the county passed to Dolça de So, the second cousin of Arnau Mir, who donated Pallars Jussà to Alfons the Chaste in 1192.
The County of Pallars Sobirà was little more than a mountainous ally of the Counts of Barcelona and decreased in importance within Catalonia. The county is rarely mentioned in the 12th century during the reigns of Artau II (1081-1124), Artau III (1124-1167), Artau IV (1167-1182) and his son, Bernat II (1182-1199).
Bernat's daughter Guillelma (1199-1229) sold Pallars Sobirà to her husband and retired to a monastery. Her husband Roger de Comenge became Roger I and, as the couple hadn't had children, started a new dynasty with his second wife.
From 1172, Empúries was surrounded by counties, such as Girona, Besalú and Rosselló, all controlled by the Counts of Barcelona, and Ponç Hug II (1175-1200), like his father Hug III (1154-1175), also suffered from economic difficulties made worse by the famines and plagues of 1193.
He attended the assembly of nobles called by Pere the Catholic in Girona in 1197 and from then onward, Empúries effectively fell under the aegis of the House of Barcelona.
Due to his close collaboration with Ramon Berenguer IV, Count Ermengol VI d'Urgell (1102-1154) received a third of the Lleida territories and repopulated them with Urgellencs. His son and heir, Ermengol VII (1154-1184), continued the policies in the Iberian penindula that Urgell his grandfather, Ermengol V (1092-1102), had pursued and spent a lot of time in the court of Fernando II of León.
Meanwhile, in Urgell, the Viscounts of Cabrera ruled in the Count's absence and as a result Ermengol VIII (1184-1209) had to face a revolt of Viscount Ponç III of Cabrera from 1190 to 1195, which he was only able to subdue with the help of Alfons the Chaste.
From this point onwards, the intervention of the King was always necessary to maintain the stability of Urgell. Pere the Catholic put down the uprising against Ermengol VIII led by the Viscounts of Castellbó, who were allies of the Counts of Foix. Similarly, on the death of Ermengol VIII in 1209, it was King Pere who guaranteed the succession of his only daughter, Aurembaix, in detriment of Guerau IV of Cabrera.