On 12 July 2006, conflict erupted along the border between Lebanon and Israel following an attempted abduction by Hezbollah that left eight Israeli soldiers dead and two others kidnapped: Udi Goldwasser and Eldad Regev, both reservists. The inexperienced coalition government led by the then Israeli prime minister, Ehud Olmert, responded with a night raid, bombing sites inside Lebanon where it believed Hezbollah had hidden its medium-range rockets.
Over the next 34 days northern Israel was hit by as many as 4,200 rockets, and by the time the war ended in a ceasefire on 14 August, with no apparent victor, both sides were exhausted. In Israel, the second Israel-Lebanon war was considered the worst military disaster since Yom Kippur in 1973. It resulted, directly or indirectly, in the replacement of the country's entire political and military leadership.
Five years later, things look a little different. The war may have been characterised by bad judgement and even worse management, but the consequences do not appear as awful as they did earlier. The Lebanese border has enjoyed its longest period of calm since the late 1960s, and this September, for the first time in a generation, a new group of first-graders will attend schools on the Israeli side of the border not knowing what a warning alarm sounds like or what it means to hide in a bomb shelter. Al-Qaeda-affiliated groups have been responsible for the half-dozen rocket attacks since the war ended but, in contrast, Hezbollah has been careful to avoid new confrontation. Fearing assassination, the movement's leader, Hasan Nasrallah, is thought seldom to leave his Beirut bunker, his only public appearances broadcast on closed-circuit television.
Olmert, whose popularity was crushed by the war (and who is standing trial on a series of corruption charges, including fraud and bribery), feels that he has been vindicated by events. "The war was handled in exemplary fashion and achieved the best possible results," he said recently. Lieutenant General Dan Halutz, the army chief of staff who was forced to resign six months after the war, used his memoirs, Straightforward, published last year, to settle old scores, and has subsequently joined Olmert's party, Kadima.
But such revisionism sits uncomfortably with the facts. Lebanon certainly suffered - 1,100 people were killed, according to news reports, and the economic cost of war was put at up to £3bn. Indeed, Nasrallah conceded not long after the war ended that, had he "known in advance that there was even a 1 per cent chance that Israel would react in this way, [he] wouldn't have ordered the abduction".
Yet the imbalance of power was obvious from the beginning: the Israel Defence Forces (IDF) are far stronger than Hezbollah and boast the region's best air force. Hezbollah's guerrillas - who number perhaps no more than a few thousand - should have been no match for the IDF's 176,500-strong regular army, equipped as it is with the best western technology and weapons. But the war was fought on Hezbollah's home turf, and because of mistakes made by Israel's elite Nasrallah dictated the terms of the campaign. Among many errors, Israel failed to enlist enough reserve forces and misread the likely effect that sustained rocket attacks would have on morale at home.
The mistakes go even further back. After the withdrawal from southern Lebanon in 2000, Israel concentrated its efforts on confronting the Palestinian suicide-bombing campaign that destabilised Israel during the Second Intifada. Meanwhile, the threat from Hezbollah wasunderestimated. When war broke out in 2006, the IDF had an effective operational plan for the first four days of conflict only. The plan was based largely on air attacks, and its initial success prompted Olmert - keen to demonstrate his leadership credentials, having recently succeeded Ariel Sharon, who had suffered a stroke - to make some ill-advised decisions. He ordered more strikes and demanded that the army set as its mission not only the defeat of Hezbollah, but the unconditional release of the two kidnapped soldiers.
Olmert was influenced by his military chief of staff, Halutz, a former fighter pilot who mistrusted ground forces. Receiving no clear orders, the army marked time for close to four weeks, wasting energy on operations apparently designed to score moral victories against Hezbollah. Nasrallah's guerrillas did what guerrillas do best: they hid and launched surprise attacks on Israeli soldiers, all the time bombarding the civilian population in the north.
When Olmert decided to go for a wider operation on 11 August, it was too late. The UN Security Council had finalised Resolution 1701, designed to bring an end to the war. But the Israeli prime minister insisted on a last-ditch military adventure: just eight hours before the UN vote, at a time when a draft resolution was already on the table, he sent tanks across the border into Lebanon.
The outcome was disastrous: 33 soldiers were killed in the final 60 hours of battle - and Israel had nothing to show for it. The public never forgave Olmert.
The gap between the public's faith in, and expectations of, IDF capabilities and its performance disillusioned Israelis. How could a third of the country be paralysed by Katyusha rockets for over a month? It seemed inconceivable that the army could not respond adequately. In fact, short-range, primitive rockets are a treacherous threat. Matching them even halfway requires extremely good intelligence, precise air power, complete co-operation between air and ground forces and an absolute determination on the part of the commanders. The IDF failed on all counts. Hezbollah compounded Israel's embarrassment and frustration by continuing to launch rockets until the final days of the war. It could therefore claim victory, because remaining undefeated is more than enough for the weaker side in an asymmetric battle. The only way that Israel could have achieved victory would have been through the surrender of Hezbollah - and Nasrallah never intended to wave the white flag.
Until the summer of 2006, Israelis had little reason to doubt the superiority of their army within the region. After all, the army had won before and it was, and remains, well financed - Israel spends 6.3 per cent of its GDP on defence, according to the Stockholm International Peace Research Institute, and receives additional military aid worth $3bn a year from the United States. The IDF's failure despite these inherent advantages underlined for the public the true nature of the threat from guerrilla operations such as Hezbollah.
As Major General Moshe Kaplinsky, Halutz's deputy during the war, said in July 2009: "For us, the war was a wake-up call. We failed because we didn't grasp in time that this was an actual war, not another medium-scale military operation. The IDF didn't do enough to take the offensive initiative and end the war sooner."
Ehud Barak, who replaced Amir Peretz as Israel's defence minister after the war, conceded in the same month that "Hezbollah perceived Israel as paralysed, weak". Another general told me: "The war was a slap in the face. We didn't realise the damage suffered by the ground forces because practice had been minimised during the intifada. We didn't understand what we didn't know."
Covering the 2006 war for Haaretz and later researching a book on it, I was left feeling as if I had been witness to a horrific road accident. As I interviewed surviving victims one by one, it was clear to me that all were traumatised by the failure. "There isn't a single day since the war when I don't wake up and ask myself: what should I have done differently?" an official who had a major role during the war said to me.
In the intervening years, there has been more investment in the IDF: new weapons, an increased focus on pre-war planning and better integration of reservists, who represent 445,000 of the total of 621,500 soldiers.
A newly emboldened IDF also began to exert its strength. First, there was a series of mysterious incidents in neighbouring Syria - Israeli involvement in which is presumed but always denied by officials. On 6 September 2007, warplanes attacked a North Korean-built nuclear plant near a town called Dir a-Zour in north-eastern Syria. According to foreign media reports, the planes were said to be Israeli; the International Atomic Energy Agency later verified that a nuclear plant had indeed been bombed. On the night of 12 February 2008, a senior Hezbollah operative, Imad Mughniyeh, was killed when his jeep exploded in Damascus. On 1 August 2008, Muhammad Suleiman, a senior Syrian general, was assassinated at his beach house.
Then, two and a half years after the Lebanon war, Israel attacked Gaza. In response to rocket attacks from Hamas, the IDF invaded most of the northern part of the Gaza Strip. "Operation Cast Lead" began on 27 December 2008 and lasted for three weeks, during which between 1,166 and 1,417 Palestinians were killed, as many as half of them civilians. The operation was greeted with condemnation by the international community; in its official Fact-Finding Mission on the Gaza Conflict, led by Justice Richard Goldstone, the UN accused Israel of using excessive force. But, for many Israelis, Cast Lead was proof that the IDF had recovered. It had hit Hamas, halted most of the rocket attacks from Gaza and recalibrated the balance of deterrence. Today, Israel's border with Gaza is mostly calm.
Meanwhile, in Lebanon, Hezbollah has drawn its own conclusions from the 2006 war. The organisation was forced, under the terms of UN Resolution 1701, to withdraw from the Israeli border but it repositioned its units between ten and 20 miles to the north. In doing so, it moved from mostly open fields to towns and villages spread across southern Lebanon. These have largely Shia populations, and it is assumed - in Israel, at least - that the people will now form a human shield, should a new conflict begin.
In September 2008, Major General Gadi Eizenkot, head of the IDF's Northern Command, tested this theory by threatening to attack those villages that allowed Hezbollah to launch rockets from their soil. Eizenkot was threatening to deploy a strategy known as the Dahiya Doctrine, named after the Shia district of Beirut where Hezbollah has its headquarters, an area that came under heavy aerial attack during the summer of 2006. A similar fate awaited the residents of Bint J'Bayel, el-Hiam and elsewhere, Eizenkot promised. However, the attack never came.
The 2006 war, unlike any before in Israel's short and unhappy history, led to a fuller appreciation of the nature of the fight against terrorism and against guerrilla forces. After the 2000 withdrawal, Nasrallah described the Israeli public as "weaker than a cobweb"; the inference was that the people could not cope with the prospect of civilian casualties. Israelis believe that they are more resilient than Nasrallah thinks, but they also know that the trick is to postpone the next war for as long as possible and to hit the enemy only as a last resort. This is in part because Israel has not had an answer to rocket attacks. The IDF recently unveiled a medium-range rocket interception system called Iron Dome; two have been deployed near the Gaza border. Israel still lacks the capacity to face down the threat from the north, but the systems that it needs to do this are now being produced.
Hezbollah is acting with caution today, yet it seems that its leaders believe they have an answer to Israel's military advantage if a war breaks out again. For decades, Israel used its superior air power, military intelligence and technological capabilities to prevent Arab victories. Yet where Syrian and Egyptian tanks failed in 1967 and 1973, guerrillas and rockets can now succeed. Hezbollah understands that it can never occupy Israeli land; it can, however, use thousands of missiles to terrorise the Israeli civilian population and prevent some of the IDF's combat planes from taking off.
The rockets can reach every important site in Israel; some can reach Tel Aviv and Jerusalem; a few can reach the Red Sea resort of Eilat, at the southernmost tip of the country. These weapons are more lethal and more accurate than ever - the Syrian-produced M600 rockets have an error range of approximately 200 metres. As a result, what now exists on the Lebanese border is a form of bilateral deterrence, under which each side can cause huge damage to the other. In miniature, this is the MAD (mutual assured destruction) doctrine that prevented a nuclear escalation in the decades after the Second World War. It is volatile and unstable but effective, at least for now.
There are two other actors at play in this conflict: Syria and Iran, Hezbollah's Shia patron. It has been reported that the Iranian leadership thought Nasrallah was wrong to have provoked Israel in 2006. This was a premature act: Hezbollah's medium-range weapons had been amassed secretly, and were only to be used when Iran wanted to respond to, say, a US or Israeli attack on its nuclear sites. Since the war, Tehran has maintained its financial backing for Hezbollah but, in return, has kept its client militia on a tighter leash. It is understood that important decisions - including when to fire rockets into Israel - are left to the Iranians alone.
Nevertheless, deterrence works both ways. During a recent public debate in Israel over the need to launch a pre-emptive attack on Iran, the former Mossad chief Meir Dagan warned that Hezbollah would retaliate against such an attack by bombarding Israel with rockets.
During the 2006 conflict, Syria similarly supplied Hezbollah with hundreds of rockets. At the time, Israel refrained from responding directly, preferring to keep an uneasy piece with President Bashar al-Assad. Assad is facing up to revolt at home, which means, in turn, that Iran will probably wait to see how the Syrian situation plays out before it orders Hezbollah to provoke Israel again.
Nevertheless, the possibility of future confrontation along the Lebanese border remains ever present, not least because Hezbollah still wants to get revenge for the 2008 assassination of Mughniyeh. Nasrallah publicly vowed to avenge his close friend's death and has tried to hit Israeli targets abroad, so far without success. When he does succeed, Israel will send its air force to attack Hezbollah positions in Lebanon - and the result could well be another war.
For now, the Arab spring appears to be preoccupying the major powers in the region, but it would be foolhardy to make firm predictions about its effects. With both sides heavily armed and mutually hostile, the Israeli-Lebanese border represents a lasting danger to the Middle East and the world.
Amos Harel is the defence analyst for the Israeli newspaper Haaretz. He is the co-author, with Avi Issacharoff, of "34 Days: Israel, Hezbollah and the War in Lebanon" (Palgrave Macmillan, £10.99)