Paddy Ashdown promised to eat his hat, Iain Dale to run naked down Whitehall, if the respective exit polls of 2015 and 2010 were right – and they were. No wonder the poll has developed a reputation for accuracy.

It was not always thus. The first British exit poll, in 1974, predicted a Labour majority of 132; the actual majority was three. But over the decades, and under the supervision of political scientist Professor Sir John Curtice, its predictions have improved.

At the last election, despite underestimating the number of Conservative seats by four, the poll correctly predicted that the Conservatives would lose their majority and need support from the Democratic Unionist Party in order to stay in government.

2015 was a blip for the poll, which predicted a hung parliament, suggesting David Cameron would be 10 seats short of a majority. Eventually, Cameron won enough to govern without the Liberal Democrats – but because the poll had suggested the Lib Dems would go down to a shocking 10 seats (from 57) and they ended up with two fewer, Lord Ashdown ended up looking foolish.

The 2015 near-miss was not enough to dispel the semi-mythical status the poll acquired in the previous two elections, when it got the majority exactly right. In 2010, it predicted Cameron would be 19 seats short of a majority; in 2005, that Tony Blair would win a majority of 66.

Top 10 marginal seats to watch at the general election Show all 10 1 /10 Top 10 marginal seats to watch at the general election Top 10 marginal seats to watch at the general election North East Fife Currently held by the SNP with a majority of 2 Getty Top 10 marginal seats to watch at the general election Kensington Currently held by Labour with a majority of 20 Getty Top 10 marginal seats to watch at the general election Perth and North Perthshire Currently held by the SNP with a majority of 21 Getty Top 10 marginal seats to watch at the general election Dudley North Currently held by independent, formerly Labour, MP Ian Austin with a majority of 22 LivingInMediocrity Top 10 marginal seats to watch at the general election Newcastle-under-Lyme Currently held by Labour with a majority of 30 Derek Harper Top 10 marginal seats to watch at the general election Southampton Itchen Currently held by the Conservatives with a majority of 31 Rob Candish Top 10 marginal seats to watch at the general election Richmond Park Currently held by the Conservatives with a majority of 45 Robin Webster Top 10 marginal seats to watch at the general election Crewe and Nantwich Currently held by Labour with a majority of 48 Jaggery Top 10 marginal seats to watch at the general election Glasgow South West Currently held by the SNP with a majority of 60 Alec MacKinnon Top 10 marginal seats to watch at the general election Glasgow East Currently held by the SNP with a majority of 75 Christine Johnstone

How does it do it? The secret is having a previous election to compare with. This is where the pollster pioneers of 1974 went wrong: with no previous poll to compare to, they were working in the dark.

Since then, Professor Curtice and company have refined a method that works well: outside a number of polling stations, every nth voter is stopped and asked to mark a replica ballot paper to indicate how they have just voted. Because the stat boffins know how the previous election’s random sample voted, they can estimate how parties’ shares of the vote have changed. From those figures, they project how that seat and seats like it might change. Over the course of today, the exit pollsters will build up a picture of how the country has voted, and how that will decide the make-up of the new House of Commons.

So when the broadcasters – the BBC, ITV and Sky News – announce the results at 10pm, they are likely to be close to the actual count. Whether their poll will get the majority – or the distance Boris Johnson falls short of one – exactly right is a matter of chance. In 2005 and 2010, they only did because minor errors in the prediction cancelled each other out.