A few days ago I visited Finlaggan on the island of Islay, the administrative centre of the Lordship of the Isles between the 13th and 15th centuries.

It was deserted, and as the early September sun set it was incredibly atmospheric. I marvelled at its age and the fact a seat of power once existed so far from the cities (Edinburgh and London) we now associate with government.

Of course the Lords of the Isles weren’t democratic in any modern sense of the word, but nor was it

monarchical. Only in 1493 did the title fall to James IV of Scotland, and

survives to this day in the hands of the heir apparent to the British Crown.

That, of course, makes the current holder the Prince of Wales, otherwise known as the Duke of Rothesay, whose mother, Queen Elizabeth, will this Wednesday surpass Queen Victoria’s reign of nearly 23,227 days. Whatever your views of monarchy, that’s a remarkable milestone.

Unlike at other points in the past couple of decades, the institution of the monarchy appears strong and durable; indeed it has to be to defy its own illogicality. For a constitutional monarchy is one of those things, like the SNP’s popularity, which on paper shouldn’t work, but just does.

But then as Disraeli once memorably quipped, “England” (by which he meant the UK) is governed not by logic but by Parliament, and since the 17th century that has provided an adequate check on hereditary power. Indeed consent remains the basis of any successful constitutional monarchy – once that disappears then a republic surely follows.

For the time being, however, consent appears steady. According to the most recent polling, a majority of Scots and Brits support the status quo with certain qualifications, i.e. a reduction in the Civil List, and even asked to consider the accession of Prince Charles there seems little appetite for an elected presidency.

The position in Scotland is a little more complicated, largely because in the past few years voices on the republican left have tended to punch above their weight, giving the impression (as on Trident) that your average Scot is more anti-monarchy than public opinion in general.

This served to highlight an interesting tension between the leadership of the SNP and its membership, what the blogger Jamie Maxwell termed “a republican party with a monarchist leadership”. An academic study of the party’s grassroots a few years ago found that 60 per cent believed a hereditary monarchy had no place in a democracy, a proportion I suspect hasn’t changed following an influx of new members.

Yet as SNP leader and First Minister Alex Salmond went out of his way to stress his party’s support for the monarchy, not just as part of the UK but in the event of a Yes vote. With Stalinist zeal he even excised a 1997 conference resolution (in favour of a referendum on the monarchy) from the party’s records: the White Paper said the Queen would stay, so that was that.

When it came to Prince Charles, the former First Minister was (and is) even more gushing, having forged a rapport with the heir to the throne prior to the 1999 Scottish Parliament elections. Naturally, the Prince of Wales took to lobbying Mr Salmond as he did other government ministers, and in response to one “black spider” missive the then First Minister said he had the “honour to be…Your Royal Highness’s most humble and obedient servant.”

Mr Salmond later decided this salutation was “inappropriate to a democratic age”, but if that was so, where exactly did that leave the whole institution of monarchy? The end result is a typically convoluted piece of Nationalist logic, i.e. a predominantly appointed House of Lords is attacked as a democratic outrage but a hereditary monarchy is praised to the hilt.

The current First Minister, an instinctive republican, is markedly less sycophantic when it comes to the monarchy, doing and saying as little as decently possible when it comes to her professional dealings with Buckingham Palace. No doubt there will be a carefully worded statement to coincide with Wednesday’s celebrations. The Queen, after all, will be on a train in the Scottish Borders.

But where some Nationalists (i.e. Mr Salmond) go too far is in trying to co-opt the monarchy as somehow entirely consistent with their independence aspirations. The former First Minister, for example, regularly refers to Queen Elizabeth as “Queen of Scots”, a position that ceased to exist in 1707 when the Kingdom of “Great Britain” replaced that of England and Scotland.

He also regularly berates the Treasury permanent secretary Sir Nicholas Macpherson for having claimed that “Her Majesty’s Treasury is by its nature a unionist institution. The clue is in the name.” This, according to Mr Salmond, is “dodgy history”, for in his historical worldview the present monarchy is not a Unionist institution at all, “having been established more than a century before the Treaty of Union”.

But it is the former First Minister’s history that is dodgy (indeed it’s striking how much Scottish history Nationalists get wrong), for although in 1603 the Scottish and English kingdoms remained separate (with distinct Courts), over the next two centuries the monarchy was central to Unionist nation building.

It was the Stuart monarchs who agitated for a parliamentary as well as a regal Union between Scotland and England, a process completed by Queen Anne in 1707, while the 1801 Union with Ireland transformed Great Britain into the United Kingdom. Not only is the monarchy the original “Unionist institution” but the present monarch is a Unionist par excellence.

From her infamous 1977 speech (“I cannot forget that I was crowned Queen of the United Kingdom of Great Britain and Northern Ireland”) to a more recent intervention (her 2014 exhortation to think “very carefully” about the referendum) that much is clear. The notion that she’s somehow relaxed about the idea of independence is as big a fiction as the supposedly apolitical nature of the monarchy itself.

Queen Elizabeth appreciates the importance of symbolism. Like Victoria she cultivates the Balmoral connection, while to mark her grandson’s wedding in 2011 she gave the future Prince of Wales English, Scottish and Northern Irish titles to emphasise the multi-national nature of his future kingdom. Her presence in the Borders this Wednesday will make a similarly symbolic point.

That said, the present monarch – about to become this nation’s longest serving – represents both the strength and weakness of the argument for a constitutional monarchy. What if the “consent” underpinning it is contingent upon the current incumbent? Few could dispute her effectiveness, but then perhaps we’ve been lucky.

Just as there can be good presidents and bad, the same is true of unelected heads of state. Such is the nature of what Bagehot called the “dignified” aspects of the British constitution, but one crucial point remains: one can’t reconcile a hereditary monarchy with “democracy”, so one shouldn’t even try.