Understandably, much attention tends to focus on election winners -- to the victors go the spoils. Studying the habits of those in government seems endlessly more fascinating, revealing, and rewarding; and on a psychological level, everybody likes a winner and nobody likes a loser.
But there is much to be gained by looking at how politicians and parties cope in defeat. It offers us much insight into a party's values and organisation. And, as Prime Ministers from Macmillan to Blair have observed, so much of the art of government is about dealing with the unexpected; so it can be invaluable to study how opposition politicians deal with adversity.
David Cameron is all too familiar with how important it can be for an opposition politician. His first year as Leader of the Opposition, in 2005-6, was something of an annus mirabilis. In his second year, 2006-7, almost everything seemed to go wrong as Gordon Brown succeeded to the premiership on the back of a short but popular honeymoon period, epitomised by the memorable promise that he was "Not flash, just Gordon." What brought that juddering to a halt was Cameron's particularly effective response to the September 2007 "Election that never was". An overnight reversal in the two main parties' poll ratings meant that for the remainder of the 2005-10 Parliament, the Conservatives never slipped back into second place. A robust, memorable performance by an opposition politician in the face of adversity can thus yield real dividends.
Unfortunately, politicians in Britain generally tend to be quite poor at dealing with defeat - consider David Mellor's ungracious response to fringe candidate Sir James Goldsmith when being unseated by Labour in 1997. And amongst parties as a whole, the problem can be even greater.
Speaking to numerous defeated MPs over the years, it is striking how they often refer to their defeat as a bereavement. This often follows the Kübler-Ross model, of denial, anger, bargaining, depression and acceptance. And sometimes, acceptance can be a long time in coming.
However, I would add that parties heading into near-certain defeat can collectively exhibit such symptoms as well. Labour activists largely went heart and soul into the 2015 general election genuinely believing they were about to win it; and on the basis of the public opinion polls (though not Labour's private polling), there seemed to be some solid evidence to support this - which made the final result all the more crushing. Lib Dems, on the other hand, went into the 2015 election on the back of four years of successive, near-identical election slaughters with the polls stuck on 7-9%, and the party at all levels doggedly displayed the first four symptoms - though most conspicuously, denial. A particularly stark example was one candidate in an ostensibly winnable seat, who confidently declared in 2012, "The boot is now on the other foot! By the time of the next  election, THEY [the other parties] will be begging to form a coalition with US - if we don't win an overall majority, which I believe we will." Such delusion and denial in the face of evidence was frankly staggering - but also widespread. Anger at the electorate, a completely irrational belief that things could still be dramatically turned around at the last minute as in a football match, and a perfectly natural depression after dispiriting canvassing returns, were all to be found in abundance before as well as after polling day. In short, the Lib Dems were - and still are - collectively behaving exactly like the Labour Party in 2010, and the Conservative Party in 1997.
A measure of culpability and contrition is essential from any party that has been soundly rejected by the electorate. This requires a signal shift from campaigning. So much of modern campaigning comes down to relentlessly repeating a finely-honed message, ad infinitum. That assumes the message is one that strikes a chord with voters. If not - as with Labour in, say, 1959, 1970, 1983 and 2010, and as with the Conservatives in 1945, 1966, 1974 and 1997 - a party needs to seriously ask itself why it so seriously failed to connect with voters, and to be open to some unwelcome home truths. That requires a very different mindset in activists from the "campaign mode" they may have been in only a few months earlier. It also requires a readiness to admit mistakes. Interestingly enough, today's Labour Party under Corbyn has not shied away from asking itself such tough questions and from admitting its past shortcomings in office, although the conclusions drawn don't seem to have gained much electoral traction so far.
Parties that fail to acknowledge they made mistakes in government are usually rewarded with a second (or third, or fourth) successive drubbing. William Hague's approach to economic policy in the 2001 election was to insist that the Conservatives had "left Labour a golden economic legacy", and to completely ignore the charge since "Black Wednesday" that the Conservatives were perceived as a party of economic incompetence. The result was an almost seat-for-seat re-run of the 1997 landslide defeat, with the Conservatives only gaining one more seat than the previous massacre. And if you want the best example of a party doggedly refusing to concede any mistakes were made and that it was the electorate which was at fault, look no further than the tone of the October 1974 election campaign of the Conservatives, which started with a hung parliament and ended in a Labour majority government.
Yet contrition cannot be forced. Sincerity is a key part of any political mea culpa. Voters do tend to sniff out insincere apologies - the most striking of recent years having been Nick Clegg's decision to apologise over fees; the apology was not for having lied, or even for having broken his promise, but for having made the promise in the first place. As others have noted, this is a bit like an unfaithful husband's defence in divorce proceedings being that he shouldn't have been made his marriage vows in the first place.
Parties that blame the voters for a previous result are particularly unpopular. Funnily enough, demonising the very people whose support you need does not tend to command their respect. Tony Blair understood this in seeking a signal shift from Labour demonising Conservative voters throughout the Thatcher and Major years (although one should not exaggerate the scale of Con-to-Lab converts Blair made - the main transformation of 1997 was the disappearance of 4.4 million Tory voters, not the gain of 1.9 million Labour ones). Voters need wooing, and tend not to respond to abuse (except in Plymouth Sutton, where the late Alan Clark kept getting re-elected, despite voicing his contempt for his constituents, whom he called, "boring, petty malign, clumsily conspiratorial, and parochial to a degree that cannot be surpassed in any other part of the United Kingdom"). It is a lesson that today's politicians - of all parties - would do well to remember.