County Cork is full of twisting little lanes, lined at this season with steep banks of wild roses, foxgloves and fuchsia; and last week I got lost in them. First the road narrowed, then it grew a strip of grass down the middle, and eventually turned into a rough gravel track that climbed steeply and turned sharply into what looked like the remains of a farmyard, where it stopped. As I started on a three-point turn, a dog began to bark and a figure appeared, a man in late middle age, who by the state of him looked to have spent an entire life among cattle, manure and straw. He was smiling.

“You’ll have taken the wrong road?”

A long conversation began. He said the same thing several times – if I wanted the Kilcrohane road, I should turn around and take the left fork at the third house on the right – but each time he added a fresh question, so that he seemed to combine two personalities.

On the one hand, it was like meeting a garrulous Irish farmer as portrayed by those old, condescending cartoons in Victorian copies of Punch magazine; and on the other, someone far more sophisticated, who had possibly learned the subtlest interrogation techniques during a career with MI6. Where had we come from? Where we staying? Did we often come to Ireland? Why were we in County Cork?

Among the rusting farm implements it seemed odd to say so, but in fact we’d come to attend a series of chamber concerts in the nearby town of Bantry, which has one of the world’s finest festivals of chamber music: Beethoven, Schumann, Schubert and composers more obscure. “Grand,” he said, and “Don’t mind the dog,” which was now throwing itself, thus – thud, thud – against the car. And then he wondered if I had “people’ from this part of the world. I said a great-grandfather had left County Cork for a career in the British army in India.

“Would that be before or after the Famine?”

I’d never considered the question, but I said, “After.” I know very little about him; until recently nobody now alive did. He served for many years with the Royal Artillery in India, married a Scottish midwife and had a family there, and eventually returned with them to Scotland, where according to his death certificate he died of “chronic alcoholism” in 1899.

Until recently, his origins were a mystery. Now, thanks to some family research, we know that he was born in Kildorrery, County Cork, in 1848, and joined the army in Cardiff in 1867, when his faith was registered as Roman Catholic – a faith that none of his children followed and some of them despised. The Great Famine lasted from 1845 to 1852; he had been born in the middle of it.

We thanked the farmer, and soon found the road that runs towards Kilcrohane, down the Sheep’s Head peninsula, a long finger of rugged land that points south-west into the Atlantic. I had always thought of my great-grandfather’s story as more Indian than Irish – it was India and not Ireland that had given us the few items of memorabilia (a tiny stuffed crocodile, for example) that my parents kept on show in a cabinet.

Here on the Sheep’s Head it was impossible to avoid thinking of such things, and of India itself. On the peninsula’s south coast, a lovely garden shaped like a runway runs down to the shore, as if waiting for an aircraft that will never land. This is the memorial to the 329 people who died when a bomb planted by Sikh terrorists destroyed Air India flight 182 on 23 June 1985, when it was 9,400 metres (31,000ft) up in Irish airspace and more than 100 miles out to sea. Just over the hill, at a remote little cove on the other coast, a plaque indicates where the writer JG Farrell was swept from the rocks and drowned on 11 August 1979. His most successful novel, the Booker prizewinning The Siege of Krishnapur, had its factual roots in the Indian Rebellion of 1857, AKA the Indian Mutiny; two other novels in his imperial trilogy evoke similar episodes of British crisis and disaster, during Ireland’s war of independence and the fall of Singapore.

In the world I grew up in, the King-Emperor had disappeared from postage stamps

Eighteen fifty-seven, 1916, 1942: the inherent drama of these and other moments in the British empire’s history makes them memorable and casts the years between into the uneventful shadows; and it becomes easy to forget that Ireland and India were part of the same empire for more than a century, with consequent opportunities for people like my great-grandfather.

“The Irish were not only the victims of the imperial state, but also some of its greatest beneficiaries,” wrote the eminent historian the late Sir Christopher Bayly, recording that Irish migration to India was “neither seasonal … nor permanent, but of 10 to 20 years’ duration, in the main encompassing the careers of soldiers, administrators and priests”.

Many recruits came from poor peasant families in the west and south. According to Bayly, the city of Cork in the 19th century “may have had a more direct personal contact with India than any other place in the British Isles, including Dundee”. Dundee was the capital of the trade in Indian jute and Calcutta (Kolkata) the headquarters of many Scottish shipping lines and tea estates; and yet, according to recent historical studies, the Irish still outnumbered the Scots in Victorian India.

Rather than a lone adventurer, which is how I’d chosen to see him, my ancestor had been part of a movement. All kinds of Irish went out – Protestants, Catholics, Ascendancy landowners, peasants – to find a country that in its famines, maladministration and incipient nationalism in some ways resembled their own. It may be no coincidence that Ireland was the first country to quit the empire and India the second, though the Irish in India identified with the rulers (of which they formed a subset) rather than the ruled. The most famous of them was invented: Kipling’s Kim, born Kimball O’Hara, “a poor white of the very poorest” born to an Irish nursemaid who died of cholera and an Irish sergeant who took to strong drink and opium, “and died as poor whites do in India”.

His fate echoes my ancestor’s, who married a midwife and eventually had her put away in a lunatic asylum, where she died of melancholia. All that was long ago. In the world I grew up in, the king-emperor had disappeared from the postage stamps of Ireland and India, and it wasn’t easy to see how the two countries could ever have been connected. What they shared, to a glancing eye, was poverty – that and a fascination with ancient and mystical things, such as spinning wheels, gurus, the Gaelic language and Celtic typography. Britain, by contrast, represented modernity: jet airliners, nuclear reactors, Everest conquered. By the time I was growing up, we’d entered the new Elizabethan age.

But that world too has gone. Ireland’s new taoiseach, Leo Varadkar, has an Indian father and an Irish mother; his father was a doctor who migrated from Bombay to England in the 1960s and in Slough met and married a nurse. Varadkar is gay. Nothing could be further from Catholic oppression of the old Irish state, or the imperial stereotypes of Punch.

England, the old imperial headquarters, is the place that has chosen to look back. In Bantry this year there are fewer visitors from the United Kingdom. Sterling’s fall against the euro is suspected. We talked about it in the refreshment tent before a performance of Beethoven’s Cello Sonata No 3. “Never mind,” said a local man, with a look of mischievous pity. “Once again you’ll be a sovereign nation.”

• This article was amended on 15 July 2017. An earlier version said the memorial to the people who died on the 1985 Air India flight 182 was on the north coast of the Sheep’s Head. It is on the south coast.

