Spain was not a single country in the early sixteenth century; instead, it was composed of two kingdoms, those of Castile and Aragon, of which the latter was actually a group of three smaller kingdoms - Aragon, Catalonia and Valencia - now united under one ruler. The two great Spanish crowns had been joined through the marriage, and rule, of Ferdinand of Aragon and Isabella of Castile, although each of the four constituent realms retained individual governments and identities. Charles was the grandson of Ferdinand and Isabella, and the dynastic link was Joanna, daughter of the latter pair and mother of the former.
Death of Isabella
When Isabella died in 1504, Castile passed to Joanna and her husband Philip; Ferdinand remained King of Aragon. However, Philip died in 1506, causing some sort of mental collapse in Joanna; in 1509 she retired to an isolated fortress called Tordesillas along with her husband's remains. Joanna's ill health may have been expected, because a clause in Isabella's will made provision for Ferdinand to rule Castile as a regent on behalf of their daughter, if Joanna herself was unable to. After crushing quarrelling rebels, Ferdinand again ruled a 'united' Spain.

