Prior to British rule in India, Delhi formed the political and financial core of many empires - including the Mughal Empire. However, long before that - in 2500 BC, the city of Indraprastha - capital of the kingdom of the Pandavas - was said to exist near the site of modern-day delhi (according to the Mahabharata - a sanskrit epic). The city of Delhi, on the other hand, was supposedly founded in 800 BC by Raja Dhilu of the Dhillon dynasty where it formed their capital too.
As well as its long history as an administrative centre in India, Delhi is far more central than Calcutta and, seeing as calcutta is in the far east of the country, it was deemed that it would be far easier to control and administrate India from Delhi, so, in December 1911, the capital of India was officially changed to Delhi.
Hope it answers your question sufficiently!