As Zimbabwe's elections hang in the balance, it's instructive to look at Robert Mugabe's master map of electoral manipulation. There are three distinct stages to how he rigs the poll.

Stage one is the skewing of the democratic environment. He has always done this. Even in the very first post-civil war elections in 1980, that brought him to power with an overwhelming mandate. Instead of moving all his guerrillas into assembly points, as agreed under the Lancaster House peace deal, he instructed a large number to stay among the rural electorate and warn them to vote for him, or else 'aluta continua' – the war continues.

Now Mugabe uses the traditional tribal chiefs to control the rural electorate. He pays them large salaries and gives them luxury SUVs, on condition they instruct their followers to vote for him. Mugabe also increased the number of rural polling stations, ostensibly, to cut the distance rural voters have to travel to cast their ballots, but actually, to impose greater scrutiny on how they vote. That way, instead of there being dozens of villages in the catchment Mugabe's men can now identify opposition votes with particular villages and threaten them with dire consequences.

Download the new Independent Premium app Sharing the full story, not just the headlines

Those consequences often revolve around food: in Zimbabwe hunger is the dictator's ally, it is easily manipulated. With so many rural Zimbabweans dependent on food aid, Mugabe threatens to cut food deliveries from areas that don't vote for his ruling Zanu-PF party (the government-run grain marketing board has a monopoly on all grain deliveries.)

To ameliorate the effects of hyperinflation, now way over 100,000 per cent, Mugabe gave teachers, soldiers, policemen and civil servants huge salary increases, in the run up to these elections. For these elections he also gerrymandered parliamentary constituencies, giving more seats to the northern rural constituencies, his traditional bastion, and taking seats away from the cities and from the south, both opposition strongholds. Mugabe also used the police and the Central Intelligence Agency to harass and intimidate the opposition, and he denied the opposition fair access to the media – especially to radio and TV, which are already state-controlled.

Finally, for stage one, in the week before the election, the heads of the security forces appeared on state media to tell the nation that none of them would allow any candidate, other than Robert Mugabe, to rule Zimbabwe – in effect, threatening a pre-emptive coup to keep Mugabe in power if he lost the vote.

The second stage takes place at the ballot box itself. The voter's roles are bloated with "ghost voters," thousands registered to a single shanty, or to bogus addresses. Voters rolls weren't made freely available to the opposition to check. Many legitimate voters (in known opposition areas) found their names had been taken off the rolls, and were unable to vote. As were the Zimbabweans in the growing diaspora, who are not allowed postal votes. Almost 70 per cent of Zimbabweans between the ages of 18 and 60 now live and work outside the country, most of whom support the opposition.

In the last two elections these two stages of rigging have been enough to get the "right" result for Mugabe. But in last Saturday's poll, the swing towards the opposition was so great that these tactics did not, by themselves, prevail. And so the Zimbabwe Election Commission (run by a former army officer and usually reliably pro-Mugabe) was faced with stage three rigging.

Theoretically this is relatively simple. At the central counting station, figures are massaged to give the desired outcome. But in these latest elections, it wasn't so simple. For one thing, they were, for the first time "harmonised" elections – four different elections in one. Voters filled in ballots for parliament, senate and local wards, as well as president. And what really hamstrung Mugabe this time, was a provision in the new electoral laws that results (of all four counts) be posted on walls on the 9,000 polling stations.

In the past, when rigging stages one and two worked well, this wouldn't really have mattered. But now suddenly it does. Opposition representatives went around photographing the posted results, and collating them. Mugabe's men were able to chase opposition observers away from polling stations in his heartlands, and it is for these that Mugabe is able to manufacture fictitious results, to swing the overall results of the presidential contest. But the Mugabe machine is not what it was. The logistics are creaking, and the once monolithic party is now faction-ridden and beset by internal succession feuds, undermining its rigging operation, perhaps fatally.

Peter Godwin is the author of 'When a Crocodile Eats the Sun', on the collapse of Zimbabwe