Appearances matter a lot in politics. But in the end, the numbers matter more. On Brexit as on everything else, Theresa May has always behaved as if she is a prime minister with a clear parliamentary majority, a united party and a reconciled country behind her. But the reality is that she is none of these things, and Wednesday’s four-vote Commons defeat has found her out.

May’s prime ministership is doomed to be defined by the jagged interface between two unreconciled mandates. The first, on Brexit, she did not want but has inherited. The second, a post-referendum parliamentary majority, she desired but was denied. The disjunction between the two outcomes still shapes everything about her government.

It is not sufficiently understood that May called the 2017 general election in part so that she would have a post-referendum parliamentary mandate to drive through the hard Brexit to which she committed – consulting only Nick Timothy – in autumn 2016. She needed that majority, so she persuaded herself, in order to compel pro-European Tories to vote in line with the manifesto and against their beliefs, and support her version of Brexit.

Politics today would be different if she had succeeded. True, nothing will stop Ken Clarke and perhaps Anna Soubry from voting against Brexit in whatever form it is presented. But May’s attempt to parliamentarise the referendum result – to translate an advisory plebiscite into a manifesto commitment for a re-elected representative government to carry out – failed. That failure changed everything, even though May has continued to pretend and perhaps believe otherwise.

The result was a corridor of uncertainty between the moral force of the leave vote in 2016 and the moral depletion of the lost majority in 2017. That space is the political achilles heel, not just of May but of Brexit itself. It makes it much easier for MPs of all parties, but crucially for Tory rebel MPs, to oppose a hard Brexit, aspects of Brexit and even any Brexit at all. It has now permitted, in the words of yesterday’s Daily Mail front page, “11 self-consumed malcontents [to] pull the rug from under our EU negotiators” in Wednesday’s vote.

Strictly speaking, this vote was not about Brexit at all, but about legislative process. Dominic Grieve’s amendment is often described as a commitment to give parliament a “meaningful vote” about the outcome of the Brexit talks between the UK and the EU. But it does not say this in the words that have now been added to clause 9 of the EU withdrawal bill. Those new words say that ministers cannot now issue the regulations they intended to use to implement a Brexit deal without passing a new statute to authorise them.

‘Dominic Grieve’s amendment in practice permits parliament to throw out a Brexit deal and thus to throw out Brexit itself.’ Photograph: Paul Davey/Barcroft Images

As several MPs from both sides of the Brexit argument pointed out in the debate this week, the government could have nipped the revolt in the bud by withdrawing the clause in the bill authorising the power to issues regulations. Something of that sort may yet happen before the bill heads to the Lords in the new year.

The impeccably principled procedural focus of Grieve’s amendment gave him a defence against being anti-Brexit, and helped to make voting against the government into an act that promoted parliamentary sovereignty against the executive, rather than an attempt to scupper the leavers. But it also produced Wednesday afternoon’s extended debate-within-a-debate in which Oliver Letwin argued, surely correctly, that Grieve’s amendment in practice permitted parliament to throw out a Brexit deal and thus to throw out Brexit itself.

In the end, this is why the vote this week was so important. In the short run, the public reminder of her weakness is embarrassing to May as she confirms her initial Brexit deal with the EU in Brussels – though she’s hardly the only leader round the dinner table with domestic political problems. It is nevertheless also a signal that the rebels can walk the walk as well as talk the talk and have to be taken more seriously – not least next Wednesday, when there is the vote on May’s foolish attempt to write the 29 March 2019 date into the withdrawal bill. All this was dismissed rather too easily before this week. It takes a lot of the gloss off what might otherwise have been a good week for the prime minister in the Brexit process.

Yet the deeper importance of Wednesday’s vote is that it keeps the Brexit issues in play. Remember the key development of the week: the Commons vote means there must be a government bill at the end of the Brexit talks. The earliest realistic date for that would be autumn 2018. Bills can be amended, perhaps over specific soft/hard policy issues in the deal, such as membership of the customs union, but also by the addition of requirements to hold a referendum on the terms, or to request an extension of the article 50 process to accommodate further talks or to allow time for a second referendum to be held. Bills can even be defeated. Though unlikely, it is not inconceivable that the May government could fall on a Brexit issue that it treats as a vote of confidence.

The chances of any of this actually happening are still small. The context in which such possibilities might be serious options are very difficult to predict. The timetable pressures on everything to do with Brexit are incredibly tight. Yet it is a fact that good judges of the political mood do not rule out such things as a second referendum as readily as they did last year. And it is also a fact that outright opponents have an emerging plan to stop Brexit altogether, to bring all the critics under a single campaigning umbrella, and have talked to top officials within the EU about aspects of the plan.

A second referendum is now absolutely central to any such effort. The reasons for this are straightforward. Many pro-Europeans hate referendums and wish to expunge them for ever from the political repertoire. But even they recognise that only a second referendum can possibly overturn the first. Only the people can change the people’s decision. No parliamentary vote would have the political or moral force to do that. If parliament killed Brexit on its own, politics would pay the price for years to come.

It remains government dogma that there will not be a second referendum. David Davis said it again in the Commons yesterday. But public opinion, which has not shifted much on the substantive issue of leave or remain, has moved markedly towards embracing a referendum on the terms. A year ago, opponents of a second vote had a 19-point poll lead. Now supporters have a lead of 16 points. That is a big turnaround. It may not survive the perception, if it develops, that May has struck a good deal in Brussels. But May herself could find that a pledge to hold a second referendum on the terms could protect her from the ups and downs of the Brexit process over the next 15 months.

The passing of the Grieve amendment is a big moment for May and for the Tory party. It may be a freak high tide of revolt against May’s Brexit strategy. Alternatively, it may be a watershed moment after which the whole landscape of Brexit options looks different. Boris Johnson said yesterday that Brexit was unstoppable. Well he would, wouldn’t he? But the events of this week have actually raised the opposite possibility – that May’s Brexit can be still be changed, and perhaps even stopped.