Before the Spain we know today was unified, there were several smaller kingdoms in the Iberian Peninsula. The biggest and more powerful one was Castile. The Spanish language is actually Castilian (the other official languages in Spain are Catalan, Galician and Basque plus a huge amount of dialects). Its king, Henry IV died in 1474. Perhaps it would have been natural for his daughter, Joanna "la Beltraneja"; of Tramara, to succeed him, but things were never so simple when it comes to royal succession.
When little Joanna was born her father named her Princess of Asturias (the title given to the heir of the Spanish crown). However there were some rumours that she was not the king's daughter, but rather Beltrán de la Cueva's (known lover of her mother) hence "Beltraneja". Some of the noblemen did not like this at all and pressured the king to name his half-brother Alfonso as his heir instead. He acquiesced in 1464.
On the following year a war began as a group of nobles proclaimed Alfonso as king, with the intent to overthrow Henry IV. It ended 3 years later when Alfonso died in 1648. He was only 14 years old. Henry got the throne back but another dispute began...who would be proclaimed his heir now? The contenders were Juana, the king's daughter (at least officially) and Isabella, Alfonso's sister and second in line to the throne.
Apparently some wanted to make her queen right away. Isabella refused to be proclaimed as such while her brother was still alive, but she did get him to name her Princess of Asturias. With the Treaty of the Bulls of Guisando they agreed she would be his heir. Henry IV tried to use her as a bargaining tool through means of several engagements: the king tried to marry Isabella off to several nobles and royals, to gain favors, power or a family alliance.
In the end she ran away and married her second cousin Ferdinand, to whom she had been engaged to almost since birth in the first place. In those days marriage between such close relatives was forbidden, but they got a papal bull of dispensation by Valencian Pope Rodrigo Borgia. They got married in 1469 much to Henry IV 's chagrin, who was completely against the marriage and did everything he possibly could to cancel out the papal pull, to no avail. He then revoked the the Treaty of the Bulls of Guisando by swearing that Joanna was his legitimate daughter and the only heir to the throne.
However when Henry IV died he either didn't write a will declaring Joanna his heir, or Isabella's supporters got their hands on it first. No will, one crown, two contestants: the perfect ingredients for the Castilian War of Succession.
Joanna realized that Isabella's supporters surpassed her own by far, though she did have powerful allies, who proposed a marriage between Joanna and her uncle, the Portuguese king Alfonso V. He accepted.
So what should have been an internal dispute became quite a large international concern; if Isabella, married to the heir of the Aragonese crown, became queen, then Castile and Aragon would be joint (thus making Spain) and the nobility of both kingdoms would be merged into one high Spanish class, whereas the same would happen with Portugal if Joanna was crowned. War now seemed the inevitable way to resolve the situation.
France and Aragon were rivals, and had been ever seen they were both trying to have control over Roussillon. So of course France supported Joanna and Portugal, lest the kingdom of Aragon become one with powerful Castile! The Duchy of Burgundy, also at war with France, became Isabella's ally. Other kingdoms stayed neutral, such as Granada, but how they would regret it later!
In 1475 the Alfonso V entered Castile. Alfonso and Joanna were proclaimed king and queen of Castile and Leon, but they found less support than expected. They marched off to Arevalo with the objective of Burgos. All the lands around Burgos were on Joanna's side, but the city itself was Isabelline. On July 19th, after Ferdinand had gathered an army in Tordesillas and found Alfonso V in Toro, but the Portuguese shunned the battle. Ferdinand, who was not ready for a prolonged siege had no other option to go back to Tordesillas.
So now Alfonso had a free way into Burgos, but decided to return to Arevalo to wait for the French forces to arrive. A few days later an even bigger opportunity presented itself, but once again, the indecisive king preferred to wait for the French. His lack of aggressiveness weakened Juana's side enormously and Burgos surrendered to Isabella instead.
To continue reading about the Castilian War of Succession and the Unification of Spain, go to Part II.