States can exist within broader monarchical unions. I have found useful accounts in Principality of Catalonia
WP and Catalan Courts
WP. It is very obvious that a Catalan polity existed for centuries until its suppression in 1714. It was usually in monarchical union with other parts of Aragon. This resembles the situation in Scotland during the Union of the Crowns. Between 1603 and 1707 Scotland and England had a common monarch, but separate Parliaments. Scotland's loss of independence dates from the closure of that Parliament, not from the installation of the common monarchy.
The BBC history page explains
James was king of Scotland until 1603, when he became the first Stuart king of England as well, creating the kingdom of Great Britain.
Great Britain had a single monarch, but it was two countries, with two parliaments, currencies, and weights and measures, until 1707. Aragon appears to have been a similar entity until 1714, with the added complexity that Aragon itself was in a further monarchical union with Castile.