ACCORDING to Downing Street, David Cameron no longer regards UKIP as a home from home for "fruitcakes, loonies and closet racists".

That was 2006, after all, and this is now. In the here and now the Prime Minister undoubtedly views the "democratic, non-racist, libertarian" UK Independence Party as a large and growing problem. The reason is simple: Tories like it.

They like being told that Britain was "tricked" into membership of the old European Common Market. It soothes them, somehow, to be told that immigration is always and forever out of control. They hear their voices echoed when UKIP demands that the Human Rights Act must be repealed, and that Britain must withdraw from the European Convention. They listen eagerly when told that the promotion of corrosive multi-culturalism can and should be halted.

Many of them think, with some reason, that the principles at stake were once Conservative principles. They hanker for imperial measures, a St George's Day bank holiday, celebrations of Britishness, more spending on defence, and an end – as a UKIP document put it in 2010 – to "misguided politically correct ideology, extremist Islam and errant nationalism from within".

The last of those seems to apply to those portions of a traditional British identity that somehow have gone missing. UKIP would end the Barnett formula, and make several English commentators happy indeed. The party would retain devolved assemblies and parliaments, but fill them with local MPs who would spend one whole week a month tending to their bits of regional business. MSPs and the like would become redundant.

That might be one reason, among several, why Mr Cameron's travails over UKIP acquire an odd tinge when viewed from this side of the Border. The insurgency staged against the Tories by Nigel Farage and his merry band in three English by-elections this week has no parallel here. In Scotland, UKIP barely exists. Given that Scottish Conservatives also struggle to be noticed, the relationship between two right-wing parties with common obsessions might seem of academic interest.

Mr Farage's party has given Mr Cameron a shock, nevertheless. The turn-outs were miserable, but UKIP came second to Labour in Rotherham and Middlesbrough. The advocates of a five-year freeze on immigration and compulsory mastery of English for new arrivals – they all learn French when retiring to France, of course – meanwhile came third in Croydon North. For the Tories, the mid-term blues were darkest blue.

Rotherham produced the most remarkable result. The by-election was called after Labour's Dennis McShane resigned over fiddled parliamentary expenses. His party held the seat comfortably enough, but UKIP's second place was not the end of the story. Humiliatingly, Mr Cameron's party were pushed into fifth, falling behind both the BNP and Respect. (If anyone is still counting, the Liberal Democrats came eighth.)

UKIP drew strength, no doubt, when two subscribers to its anti-immigration policy were rejected as the foster parents for the children of immigrants, but the pattern evident in all three by-elections was clear. For once, Mr Farage's bluster is justified. In parts of England, his party is emerging as a rival to the Tories. On Mr Cameron's backbenches there is already talk of pacts and non-competition deals. Some have even speculated, contentedly, about the possibility of a new coalition.

The Prime Minister assumed the leadership of the Tories with a promise to "detoxify the brand". As his Home Secretary, Theresa May, once observed, they had come to be seen as "the nasty party". Mr Cameron therefore set out his stall as a social liberal, open to persuasion on climate change and gay marriage, liable to "hug a hoodie" at a moment's notice, and determined to avoid the old, suicidal, internecine conflicts over Europe. He and those around him were economic conservatives, nothing – or so voters were led to believe – more.

UKIP counts as a flanking movement. So Mr Farage sends his forces off to the right to make common cause with Tory MPs who recognise no other point on the political map. The latter group has been grumbling about Mr Cameron almost from the start, partly because he failed to win the last election convincingly, partly because he broke his word over a European referendum. These Tories want nothing more than that "in-out" plebiscite.

Mr Cameron truly doesn't want that nightmare. He is sceptical about the EU, not stupid. So he attempts to placate his pocket patriots with the kind of stern language he employed during the recent row over the EU budget. But UKIP's growing success, pushing every right-wing button while insisting that the party is in all things respectable and "mainstream", is fast rendering the Prime Minister's position untenable. It could mean the difference between success and failure at the next General Election.

How would UKIP's new-found supporters jump, if push came to shove? It's an interesting question. Either they blackmail the Conservatives into some sort of deal, with a binding European referendum as their price, or they stick to their guns, destroy Mr Cameron, and allow Labour back into office. Mr Farage, basking once more in his own self-regard, is talking tough.

For Scots, what of it? UKIP has no traction here. The party's Scottish wing seized on a YouGov poll in September claiming support at 8%, double its previous figure, but that survey involved a 3% margin of error and reflected a continuing Tory decline. Those are slim pickings. UKIP remains irrelevant, in a fundamental way, to Scotland and its politics.

Save in this: the potential effect on Mr Cameron. If he performs the traditional Tory lurch (further) to the right to placate UKIP in the south, it will do his Scottish party no good whatever. If he does so as austerity grinds on and Scotland's own referendum approaches, he invites catastrophe for "UK" and its union. Yet what else can he do? He is being painted into that blue corner because of a party whose outlook and instinct are at least as unappetising as anything he ever embraced.

It counts as his problem. It also counts, though, as a reminder of what the UK and "Britishness" have come to mean for those on the right in English politics. For these super-patriots, the consequences of their bickering over what is true, very blue and British are irrelevant. They are arguing over England, over English votes and English attitudes.

UKIP's modest Scottish representation would dispute this, of course. Its website remains a clone, nevertheless, of the authorised, "national" version with a few blogs attached. These discuss Europe and "freedom" endlessly; they deplore "separatism", but have precious little to say about Scotland save in connection with the doughty defence of Britannia. The party managed 38 candidates in the last council elections, achieving 4289 first-preference votes.

Hardly contenders for power, then. But the fact remains that this minor phenomenon in Scottish life could have a major influence on Scotland before much longer if Mr Cameron cannot square the circle. That qualifies as troubling in its own right. Yet if the Prime Minister decides he must placate UKIP and his right-wingers on the eve of a Scottish independence referendum, fun – if that's your taste – will follow.

If nothing else, it will demonstrate what Mr Cameron is really prepared to do, and not prepared to do, to preserve the Union. Three otherwise irrelevant English by-elections say that the betting is on patriotic libertarians with a hazy sense of Britishness.