It’s refreshing to experience a general election in which the polls and the pundits are proved massively wrong.

It’s especially invigorating when the stakes are as high as they were on thursday. After all, a different result could have had huge domestic and international ramifications in fairly short order, beginning with a collapse of the pound and perhaps culminating, in theory, in the UK’s nuclear disarmament and departure from the UN Security Council.

But the unexpectedness of the final result also makes you wonder how disconnected from the electorate the political and media classes really are. The whole computer-assisted modern apparatus of marketing, polling and focus grouping seems not to work as well as advertised when the country is in the midst of a tectonic political shift.

Among other things, the election proved that the celebrated “detoxification” of the Tory brand was not, in fact all that successful. But it indicated at the same time that that Tory “toxicity” may not really matter, at least in the current economic and political climate. After all, tens of thousands of people apparently lied to pollsters and journalists about their intention to vote conservative, and then went ahead and ticked the Tory box…

That said, one great danger for the new government is that Cameron may believe that the resulting Tory victory was attributable to his own qualities and actions rather then the unattractiveness of the Labour alternative combined with the surge of Scottish nationalism.

It seems likely that millions of people in England and Wales were simply unwilling to gamble Britain’s relative prosperity and low unemployment on a return to the old-fashioned socialism believed in by Ed Miliband. Others weren’t willing to gamble on a socialist project if it was to be led by such a smug and untrustworthy-seeming young man.

In the old industrial cities of England, a significant number of traditional working class Labour voters who might have supported Miliband’s economic policies were probably alienated by the way the Labour leader personified the domination of the party by upper-middle-class metropolitans like himself.

The fact that Miliband’s personal toxicity was not fully reflected in the polls or journalistic coverage suggests that both operated with some kind of pre-existing bias in favour of the Labour party.

In Scotland, the problem with Labour was different: a population steeped in 1970s-style socialism was no longer willing to vote for a local Labour party that had become offensively complacent, lazy and corrupt after years of unchallenged dominance.

Indeed one of the underlying themes of the 2015 election, and one that Cameron and other party leaders will ignore at their peril, is the deepening alienation of many working class voters from both the “London-centric” political and media elite, and from established party machines in the big cities

It is an alienation that simultaneously manifests itself in UKIP votes in England – more than three million of them, and in 1.5 million SNP votes in Scotland, 50% of the total cast there. It’s easier to overlook the former than the latter because of the weird distorting effect of Britain’s “First Past the Post” system as currently constituted: with the SNP getting 58 seats for 1.5 million votes, and UKIP getting one seat for almost 4 million votes.

The fact that UKIP won fewer seats than expected and that its leader Nigel Farage failed to get in and had to resign, should not distract observers from the fact that UKIP proved itself to be a truly national party, gaining significant votes all over England and Wales, and often coming in third or even second place. There’s also little question that many UKIPers, especially in the South, voted tactically, their desire to keep out a Labour-led coalition overcoming their disillusion with or dislike of David Cameron’s Tories.

It now seems possible that Labour could go into catastrophic decline in much the same way that the Liberal Party did in the years after World War I, despite having played a dominant role in British politics for more than half a century. Certainly the results from London suggest that Labour may become more and more reliant on the votes of immigrant communities and racial minorities.

At the same time, if UKIP survives Farage’s resignation or if another alternative party should emerge that can appeal to white working class voters who are tribally allergic to the Tories, then Labour’s vote may well shrink much further in the midlands and industrial North.

As for the LibDems, their extraordinary rout felt like karmic punishment for their hypocritical and dishonest refusal to support customary redistricting of electoral boundaries while in the Coalition with the Tories. The actual mechanism of their defeat though, seems to have been partly a matter of tactical voting by a British public that had a taste of coalition government and doesn’t like it. But it may also have had a lot to do with the disillusionment of those voters who foolishly believed before the formation of the Coalition that the LibDems were principled outsiders, unsullied by and immune to the compromise and corruption that comes with political office.

Some of the lessons offered by the election are contradictory. In large parts of the Kingdom, many voters seem to have made a cool calculation that their material interests would be served by the continuation of relatively responsible, cautious and competent economic management, an option which was offered by only one main party. But elsewhere, and especially in Scotland, large numbers of people were motivated by intense political emotion and by concerns about identity and national pride. All of the latter were noticeably absent from the campaigns by the Westminster leaders. But then none of the three are as obviously talented and appealing as the SNP’s Alex Salmond and Nicola Sturgeon.

But the big reveals are yet to come. For instance, will a David Cameron unrestrained by coalition partners behave differently now that he has an actual majority? Critics within the Tory party have long worried that he lacks a vision for the country, that the only thing he believes in is own suitability for the top job. Arguably he has never had to demonstrate political courage by leading public opinion or standing up for a potentially unpopular person or policy, all of which may be necessary if he is steer a country rattled by a massive electoral shifts.

It is possible that Cameron will decide that the collapse of Labour and the Lib Dems vindicates his “essay crisis” style of leadership, his faith in “branding”, his lack of interest in foreign affairs, his downgrading of the armed forces, and his insistence on a lavish foreign aid budget at a time of austerity elsewhere.

But now that there are no LibDems to blame for broken promises, humiliating compromises or the shambolic execution of government policy, Cameron will find himself under much more pressure from Conservative MPs whom he prefers to be quietly deferential and whose opinions he has shown little respect for.

At the same time he will have to confront a new SNP bloc that is considerably further to the left than the Labour party, and which because of its youth, inexperience and Anglophobia, (not to mention its desire to break up the Union, not necessarily shared by all SNP voters) may turn out to be a disruptive force in Parliament.

More important, Cameron and his team are going to have deal with national challenges that make questions of NHS funding and mansion taxes seem insignificant. Not least the constitutional reforms that may be needed to keep the country together. But there are also other important issues that went all but unmentioned by everyone during the campaign: foreign alliances, immigration, defence, freedom of speech, foreign aid, the crises in Ukraine and the Middle East, social cohesion, and the special relationship with the United States, all of which demand a vision of the country the UK is going to be and the role it will play in the world.