Theresa May is a cautious politician. She has risen to the top by avoiding unnecessary risks; no one survives 18 years on the Tory front bench by being a gambler. But few prime ministers have the luxury of choosing their battles, and she would not have chosen the two that may now define her premiership: successfully negotiating Britain’s exit from the European Union while saving the United Kingdom. If she achieves both, she will join the pantheon of great prime ministers. If she fails, she’ll be keeping Lord North company in the history books.

Unlike David Cameron, May has been preparing for a new Scottish referendum from the moment she entered Downing Street. Sturgeon made it clear on the day after the EU referendum that she regarded another independence vote as highly likely — her party’s membership has trebled since 2014. It is no coincidence that May’s first words on the steps of No. 10 were about the Union’s personal importance to her. She made sure that she travelled to Scotland straight after becoming Prime Minister, ensuring that the Nationalists could not easily paint her as a Little Englander. But she now finds herself in a political duel with Sturgeon that only one of them can survive.

James Forsyth and Alex Massie consider Theresa May's options:

So we have two cautious women both pushed into taking career-defining risks because of the gambles of their male predecessors: May because of David Cameron’s decision to hold a referendum on EU membership; Sturgeon because Alex Salmond encouraged the SNP membership to believe that a referendum on independence would be won next time.

Sun Tzu would approve of Downing Street’s approach to Sturgeon’s demands for a second independence referendum: No. 10 aims to win without fighting. When I asked one of those intimately involved in Tory preparations for ‘Indyref 2.0’ how you win, I was told: ‘We will win by resisting it.’

This isn’t about blocking a referendum: No. 10 knows that the approach Madrid takes with Catalonia could backfire in Great Britain. The crucial aspect, given how few Scots want another referendum, is to appear to be the more reasonable side. A straight ‘no’ to a second referendum would be arrogant, aloof. But No. 10 believes that many Scots will thank Mrs May for delaying the poll, because so much is currently unclear. For instance, no one can know for sure what deal the UK will strike with the rest of the EU, or how it will work out. Only time will tell. Equally, it is far from apparent what relationship with the EU or the single market an independent Scotland could have.

But Downing Street is privately moving towards a bolder position now. This would see Mrs May insisting that Ms Sturgeon secures a mandate for a referendum in the next Holyrood elections (which are not scheduled till 2021). Such a demand will infuriate the SNP; Nicola Sturgeon has been taking to Twitter with almost Trumpian energy to say that her democratic mandate is bigger than the unelected Mrs May’s. She argues that the SNP manifesto made it clear that a ‘material change’ could lead to a second independence referendum — and who would deny that Brexit meets that test? With the support of the Greens, there is a majority for another vote at Holyrood already.

Crucially, though, the Scottish public seem to have sympathy with the idea that the Nationalists need a fresh and firm mandate for another referendum. One of those involved in devising the unionist strategy tells me, ‘The 2021 stuff is being tested and the results are emboldening us.’ Since the last referendum, there is no sign of a significant change in opinion in Scotland, with support for independence still around the 45 per cent mark. Even Brexit didn’t really move the dial, and even fewer Scots agree with Ms Sturgeon that a referendum should come in the next two years. So if May delays, and insists upon the SNP winning a direct mandate, many Scots will thank her for it.

There is, however, a significant chance that the next Holyrood elections will be earlier than 2021. The SNP want to cut air passenger duty in their next Budget, and it is hard to believe that the Greens could support that. This would mean the Budget couldn’t pass, creating a pretext for another election — so Ms Sturgeon (who lost her party’s majority at the last Holyrood election) would be forced into another gamble. An alternative scenario is that Sturgeon could resign as First Minister if a referendum were refused, knowing that no alternative government could be put together, thus forcing an election.

The Tories calculate that any quick Holyrood election in which a second referendum was the main issue would help them, because the SNP and the Greens would struggle to take a majority of the seats. One strategist tells me: ‘It is a risk, but it is less of a risk than having a second referendum.’

What is certain is that No. 10 will take a more combative approach to the negotiations about the referendum than David Cameron did. Cameron’s Downing Street was acutely aware of how little it understood Scottish politics. Whenever anyone in cabinet grumbled about Labour’s approach to the Scottish referendum in the run-up to the 2014 vote, Cameron was quick to remind them that the Tories were the third party in Scotland and the Lib Dems the fourth: the Union needed Labour to win. But May’s No. 10 is much more confident of its position. The Tories are now the official opposition in Scotland, and Ruth Davidson, leader of the Scottish Conservatives, surpasses Ms Sturgeon in the popularity stakes. May’s chief of staff is Scottish — and Fiona Hill has never knowingly given an inch in her life. One Tory tells me, ‘Far too much was conceded in the Edinburgh agreement. This is not going to be a simple cut-and-paste job.’

The campaign for the Union will also be different this time around. There is a recognition that it cannot be a case of ‘Vote for us, or your mortgage gets it’. The government intends to forge a more positive case. Ministers point to the emotional language that May used about the Union — ‘the precious, precious bond’ — when she first entered No. 10 as a guide to their approach.

So she will aim to make the positive case that Better Together did not. Whitehall departments have been told to announce good news in Scotland wherever possible. There will be an effort to portray ‘global Britain’ as an attractive, outward-looking country that the Scots should want to be part of. I’m told that the single market and free movement don’t hold much sway in Scottish focus groups, but the question of ‘What kind of country do we want to be?’ does.

At a recent cabinet meeting, Ben Gummer — the minister for the Cabinet Office — set out the case for the Union that he thought the UK government should be making. Gummer is 39, bright, and a growing influence in No. 10. As one secretary of state comments, however, the ‘Union values’ that Gummer set out were ‘an extremely good Peterhouse essay. But I’m not sure how translatable into political messages they are.’

The economic case for independence might be weaker than in 2014, but as the SNP like to point out, they only need one in 20 voters to change their minds in order to win this time. That bit of maths shows why no one on the unionist side can afford to be complacent. Another pressing factor, arguably bigger than Brexit, is the collapse of Labour. In 2014, one could reasonably argue that there might be a Labour government after the next general election. But now it is hard to dispute Sturgeon’s assertion that the Tories are set for a decade or more in power at Westminster.

What is certain is that the prospect of another Scottish independence referendum complicates the UK’s EU exit negotiations. The deal agreed must be defendable in any Scottish referendum, which makes the prospect of walking away and simply trading on World Trade Organisation terms less practical. The likelihood of another Scottish referendum gives the EU negotiating leverage. By threatening to make encouraging statements about an independent Scotland’s prospects of joining, the EU can push the UK into being more generous with the so-called ‘divorce payment’.

The terms of the Brexit deal remain unpredictable. In part, this is because London doesn’t know who it will be negotiating with, given the forthcoming elections in France and Germany and possibly Italy. Those involved in Whitehall’s preparations for the talks predict a ‘very rocky start’, as the EU insists it only wants to talk about the divorce bill, while the UK is adamant that it will only discuss terms if future trading relations between the UK and the EU are also on the table. It is hard to see who can break the deadlock until there is a new German government in the autumn, meaning that the talks could initially look like they have failed to launch.

Some say that difficult Brexit negotiations will help the Nationalists make the case for leaving the UK. But these talks are a double-edged sword for the independence camp. When Scots see how difficult it is to unwind a 40-year diplomatic union with Brussels, they might think twice about leaving the UK. Imagine the difficulties in dissolving a 300-year union — one sealed by a shared currency, military, social security system and national debt. For years, Scottish Labour kept the SNP at bay by arguing that divorce is a brutal business. Difficult Brexit negotiations would reinforce this powerful point.

There is another Brexit paradox. The fact the UK is leaving the single market considerably complicates the case for Scottish independence. The arguments that the SNP have built up for breaking away over the past 20 to 30 years had assumed that both Scotland and rump UK would be in the EU and hence there would be no tariffs, no customs checks, and continued free movement.

But with the UK leaving the single market, it is harder to guarantee all these benefits. Indeed, the desire to avoid customs checks on the borders is why many in the SNP are now cooling on European Union membership. If an independent Scotland were an EU member state, Brussels would demand checks on the border with England. But if Scotland stayed out of the EU Customs Union and instead joined the looser European Economic Area — as Norway has done — then there is more of a chance that things could stay as they are.

Theresa May has always said that she doesn’t want her government to be defined by Brexit. Her wish has now been granted: it will be defined by Brexit and the battle for the Union. For May to win on both fronts will require nerve, verve and luck. There can be no repeat of the unnecessary mistakes of the Budget in these campaigns. There is no room for error.