When Fernando died without an heir, the Spanish claimed the throne through a web of intermarriages between the two royal houses.
Through marrying their children, Spanish royalty was able to maintain their claim to the throne.