Image copyright Getty Images

As India and Afghanistan go to the polls, historian William Dalrymple reflects on the similarities and differences between the two countries.

It's a surprisingly short flight from Delhi to Kabul. Within 90 minutes - far less than it takes to get to either Mumbai or Kolkata - you are a world away from the green tree-lined avenues of Lutyens' Delhi, and you find yourself surrounded instead by the dusty concrete blast walls, the razor wire and the sandbagged checkpoints of the perennially tense and occasionally violent Afghan capital.

There might seem at first to be nothing to link these two disparate places. India, after all, is a poster-boy post-Colonial success story: the largest democracy in the world, widely perceived as a superpower-in-waiting, famous for its software genii, its Bollywood babes, its strong economy and its super-rich business magnates, while Afghanistan is widely written off as a nearly-failed state, a former centre of Islamic radicalism, the poorest country in Asia and the third most corrupt country in the world.

About the author William Dalrymple is a writer and historian

A Point of View is usually broadcast on Fridays on Radio 4 at 20:50 BST and repeated Sundays, 08:50 BST Or catch up on BBC iPlayer

Only the gorgeous domes of the Mughal monuments in both cities stand visible witness to a shared history. For Delhi has traditionally been far more closely linked to the Afghan capital than it has been to, say, Chennai. As recently as the 1730s Kabul was ruled from Delhi, and many of India's greatest rulers - Ashoka, Kanishka, Shah Jahan - presided over empires that encompassed both cities.

This week, Delhi and Kabul find themselves linked again in the news by simultaneously holding pivotal elections, the results of which will radically change the future of the region. For a decade, both countries have enjoyed a period of unusual political stability and continuity: President Karzai has been ruling Afghanistan since 2001, while in India the Sikh economist, Dr Manmohan Singh, has been prime minister at the behest of the Nehru-Gandhi dynasty and the Congress Party since 2004. But both rulers have now come to the end of their term in office. The elections in both countries are likely to throw up a very different group of successors with very different approaches to power.

In both cases, electoral choices will be determined in part by identity politics, drawing on and potentially exacerbating the ancient divisions of both societies. In Afghanistan those faultlines are primarily tribal and ethnic: the three leading contenders, Ashraf Ghani, Dr Abdullah Abdullah and Dr Zalamai Rassoul all come from rival tribal groups - Ghilzais, Durranis and Tajiks, and behind the sophistication, sharp suits, doctorates and hugely cosmopolitan CVs of the three lie the traditional tribal blocks that have defined the country's internal divisions since Afghanistan assumed its modern borders in the 1840s.

Image copyright Reuters Image caption Rahul Gandhi is running against Narendra Modi in the election

The Indian contest also pits very different worlds against each other, as Narendra Modi, the Hindu Nationalist son of a station chai-wallah, takes on Rahul Gandhi: Jawaharlal Nehru's great-grandson, Indira Gandhi's grandson and Rajiv's now-fatherless son. Here the election represents a whole world of contestations: Left against Right, insider against outsider, secular Nehruvian vs sectarian Nationalist, Brahminical dynastic princeling vs lower-caste, working-class, self-made man.

The relationship between religion and politics will play its part in both elections: both polls are in many ways referendums among two deeply religious peoples about what role religion should play in their societies. The boycott of the Afghan poll by the Taliban means that participation is in some ways a positive choice for a world where politics is kept at some distance from religion, and against the world of the Taliban, where Mullahs will play a key role in matters of state and an extremely harsh interpretation of Sharia law will determine all aspects of personal behaviour.

In India, likewise, the Congress proudly trumpets its secular credentials, while the BJP, equally proudly, believes that India is in essence a Hindu nation which should be ruled according to the rules of "dharma" - defined variously as righteousness, or duty. One of the key promises in the BJP election manifesto, which was released this week, is the promise to build a temple at Ayodhya on the site of a mosque destroyed by Hindu activists in 1992 which is said to mark the birthplace of the Hindu God Lord Ram.

Image copyright Getty Images Image caption An Afghan woman casts her vote at a polling station in Jalalabad in April 2014

Equally, in both polls, it is economics that will do much to determine electoral choices: both countries have seen their economies slow down amid accusations of corruption and mismanagement, and it is these disappointments which are generating the appetite for radical change. A decade ago both India and Afghanistan seemed to be on the verge of reinventing themselves. Afghanistan looked set to enter a new era of peace and prosperity after 30 years of conflict, while India seemed about to take its rightful place at the world's top table, as a nuclear-armed, economic super power who would balance the rise of China. In both countries that optimism has now given way to intense anger as a new, young electorate, many of them voting for the first time, express their disappointment and demand change.

Yet for all these similarities, I personally feel very differently about the two polls. In the case of Afghanistan, a country whose troubled history I have spent the last five years writing, the poll is done and whoever the winner is, I already feel intense relief at the way the election has gone. For the level of participation was so massive, and so unprecedented, that all over the country ballots began running out as early as midday. Despite heavy rain, nearly twice as many people - an extra three million - voted in this election than in the previous one: seven million out of a total electorate of 12 million. For the first time in its entire history, Afghanistan will have a relatively peaceful transfer of power via the ballot box.

Image copyright Getty Images Image caption Men hold up their national identity cards as they queue at a polling station, Afghanistan 2014

The election this week took place without accusations of large scale rigging or any massive Taliban 'spectaculars' to disrupt the voting. This reflects the fact that security, while far from perfect, has not collapsed since NATO troops withdrew from front line combat roles at the end of last year. Moreover, the three front runners are all deeply sophisticated men. Ashraf Ghani, for example, is a former World Bank official, a PhD from Columbia, a finance minister, and an ex-university chancellor. These are impressive candidates by any standards anywhere in the world. It is possible now to hope that new era of Afghan history really might have begun.

In contrast, in India, a peaceful stable country I love and where I have chosen to make my home for most of the last 30 years, I feel a deep sense of unease about the ongoing election. In particular I find it difficult to suspend my anxieties about Narendra Modi, the BJP candidate who all the polls agree is likely to win the election. Modi is a hugely popular, even cult figure for many in India and even for those who do not share his Hindu nationalism, he represents hope for an economic rebirth of the country.

I understand why so many Indians feel a need for radical change, and why the thought of another five years of dithering and corrupt Congress government fills them with dismay. But I do not understand why so many are willing to overlook Modi's questionable record with India's religious minorities.

Image copyright Reuters Image caption Narendra Modi is the prime ministerial candidate of India's Bharatiya Janata Party (BJP)

In 2002, the year after Modi became chief minister of Gujarat, more than 1,000 people - mostly Muslims - were killed and 200,000 displaced in terrible inter-community fighting. Modi, who prides himself for his hands-on administrative skills, was accused of allowing the riots to happen, or even ordering the police to let the rioters get on with their work - something he has always denied. In a rare comment on the subject last year he said only he regretted Muslims' suffering as he would a "puppy being run over by a car".

It is true that on the campaign trail, Modi has kept his Hindu nationalism hidden and presented himself as the technocrat administrator who can turn the country around. It could be that I am worrying needlessly and India will get a leader who can really kick-start the economy, who is incorruptible and has left his sectarian past well behind him. I hope so.

Either way, these two elections show one thing very clearly: that democracy now has an irresistible momentum in this region. In Afghanistan 58% of the electorate exercised their vote despite all the Taliban's threats of bombing poll centres. In the first round in India the figure was 75% in Assam and 85% in Tripura. This is something that was by no means predictable when I first came to the region in the early 1980s - Afghanistan was then ruled by a Marxist dictatorship, while in India, memories of Indira Gandhi's suspension of democracy during her disastrous Emergency were still fresh. Now whatever else may happen in the elections, it is clear that democracy is an unstoppable force in south and central Asia, and that, at least, is very good news indeed.

A Point of View is broadcast on Friday on Radio 4 at 20:50 BST and repeated on Sunday at 08:50 BST. Catch up on BBC iPlayer

Follow @BBCNewsMagazine on Twitter and on Facebook