Why it's the capital
In June 1561 King Philip II moved his royal court to Madrid and set it up in the old castle, the alcázar. Apart from a short period from 1601 to 1606, when the court moved to Valladolid, Madrid has been the capital of Spain ever since.