Answer
The answer lies in the successive incapacitation of Ferdinand's elder brothers, Carlos, Prince of Asturias, who had a mental disability and learning difficulties, and then Juan, Prince of Asturias, who died in infancy. These circumstances thrust Ferdinand into the position of heir to the throne of Spain.