Barely a few paces from the Egyptian border stands a large white tent, fashioned from plastic sheeting and pockmarked with jagged shrapnel holes. Inside, as in the hundreds of identical tents dotted to the left and right, is a scene of energy and illicit industriousness: a dozen Palestinian smugglers sweating to overcome the punitive economic blockade on Gaza. A stone's throw away on the opposite side of the border is an Egyptian police post, with relaxed uniformed officers standing on the roof. They gaze down without a hint of concern.

One unanswered question of Israel's three-week war in Gaza is why the air strikes, artillery shells, tank fire, bulldozing and detonations that caused such devastation and loss of life across the territory did so little damage to the hundreds of smuggling tunnels under Gaza's southern border with Egypt. Those tunnels, which bring in food, clothes, machinery as well as weapons and ammunition, were supposed to be one of Israel's key targets. On the final day of the conflict alone, the Israeli military said it had hit 100 tunnels. Gazans in the border town of Rafah spoke of night after night of enormous air strikes that shook cracks into the walls of their houses and shattered their windows.

But while the sandy border is marked with many large craters, the damage caused to the tunnels was, in many cases, repaired within days. Already some are operating again and new tunnels are being dug under the close eye of Hamas officials, who walk from one tent to the next clutching their walkie-talkies.

The smugglers believe their tunnels were simply too deep to be badly damaged, even by the heavy 500lb or one-tonne bombs dropped by Israeli F-16s. In most cases, the serious damage was only to the entrances to the tunnels, which were soon uncovered again by the Palestinians using bulldozers and then rebuilt. It may be that the focus of the Israeli attacks was on the weapons tunnels, which are closely guarded by Hamas and other armed groups and not open to public view.

Inside the large white tent is a wooden coat rack from which hang the jackets and spare clothes of a dozen men or more. To the right is an electrical circuit board with five sockets. From the back, the wires run out of the tent, across the sand dunes and directly into the public electricity supply of the municipality of Rafah. From the front, a cord runs out to power a winch. Outside, a large black plastic water butt with a tap provides the thirsty workers with fresh drinking water - again, courtesy of the municipality. All of this is registered and paid for. Smuggling in Gaza is a semi-official business.

The focus of activity is the tunnel's well: a 15m deep shaft lined on its four sides by planks of wood. Three metal beams are positioned pyramid-shape over the well and support the electric winch, whose cable runs down the shaft to the sandy floor below. There, two men crouch low and operate two more winches that run horizontally 300m to the south along the tunnel, stretching out of Gaza and into Egypt. One of the winches draws in the goods from the Egyptian side, a train of boxes and sacks sliding over the sand on plastic containers. The second winch sends back the empty containers for reloading.

It took about eight weeks to dig this tunnel; a team of men worked long days underground using a pneumatic drill to dig out the soil, which they then carried out in large, plastic containers and dumped nearby. By the time it was finished, the tunnel was tall enough for a man to stand with his head bowed, and nearly a metre wide along its full length. The tunnel walls are bare soil with regular wooden supports to prevent collapse - although it still remains a dangerous business. Around 40 Palestinian tunnellers were killed last year in cave-ins.

It is midday and the work is constant. Every 30 seconds one of the men below shouts "Raise" and a man sitting over the mouth of the well switches on the winch and pulls up another sack. So far this morning, they have contained: dry, yellow chickenfeed; spare parts for cars; a box of coat hooks; microwaves; kerosene cookers; packets of rather dowdy women's underwear; and now several large, 5.5kW generators.

Notably absent are drugs and alcohol, which are forbidden by Hamas; cigarettes, which are heavily taxed by Hamas; and anything even resembling weaponry or military material, which come in through more discreet tunnels far from the public eye that may or may not have been more seriously damaged by the war.

"Without these tunnels, everything would stop in Gaza," says one of the workers, who gave his name only as Abu Zeid, 22. "And they say we are terrorists. Where are the terrorists here? The world knows very well what's going on, but they don't want us to live. If they opened the crossings, why would we need to do this business?"

Since Israel pulled its soldiers and settlers out of Gaza in mid-2005, it has imposed an ever-tighter economic blockade on what it calls the "hostile entity". For the past year and a half, that has meant closures of the crossings: banning all exports and prohibiting all imports, save for a limited list of humanitarian goods. Even the UN secretary-general Ban Ki-moon called it "collective punishment" - illegal under international law. It has left more than 80% of Gazans reliant on aid.

The policy was designed to weaken Hamas and convince the Palestinians they had made a mistake when, in 2006 - in what was widely acknowledged as one of the most free and fair elections in the Arab world - they voted in strength for the Islamists. Egypt has also kept its border crossing at Rafah largely closed. "It's politics, dirty politics," says Abu Zeid.

Most of the workers in this tunnel were once employed as daily labourers within Israel, but Palestinians have long been refused such jobs. Now in Gaza there is barely any work available. Some at this tunnel are former policemen once employed by Hamas's bitter rival, Fatah; others are farmers whose livelihoods collapsed with the ban on exports. "There is nothing for us except the tunnels," says another worker.

"I have a house, and land and money but I want to go abroad," says Abu Eyash, 28, a tunneller who once spent four years in an Israeli jail for his connections with Fatah. "I'm not satisfied here. There's always war and never any security."

These men may not earn much from the tunnels, but others do. The tunnel cost around £100,000 to build and the owners say they earned that back within the first two months. The original owners of the land are given a 10% commission and Egyptian security officials on the other side earn healthy bribes. As his staff worked, one of the owners took out a thick fold of dollar bills, from which he was to send the equivalent of £13,000 to the Egyptians, enough to provide protection for the tunnel for around 10 days until the next payment was due.

In the last two weeks since the end of its war in Gaza, Israel has launched several more air strikes against the tunnels after militants from small, non-Hamas groups fired rockets and mortars into southern Israel. This tunnel was one of those hit, although the workers said the damage would take only a few days to repair.

Not everyone celebrates the tunnel industry. A short walk back from this tent is the home of Mohammad Abu Saud, 40, who is spending the day covering his broken windows with plastic sheeting and wondering how he is ever going to repair the massive cracks in his walls caused by the bombing of the tunnels. "I don't earn any benefit from the tunnels and I'm suffering because of them - you can see the cracks here and the windows gone, as well as the fact that the prices in the market have risen a lot," he says.

"I think the tunnels are delaying a solution," says his brother Ala'a, 35. "If there were no tunnels, there would be such a heavy price that it would force Hamas to sit and find a solution and the only solution is to reopen the crossings. I'm not even asking them to liberate Palestine, just open the crossings."

Around half an hour's drive north from the border are the recently destroyed remains of what, a month ago, was one of the largest food-processing factory compounds in the Gaza strip, owned by the wealthy al-Wadeya brothers. Yaser al-Wadeya has a PhD in industrial engineering from Cleveland State University and little sympathy for Hamas. He estimates the damage caused by the Israeli military to his biscuit, ice-cream, snacks and dessert factories is worth around £15m. Even if he had the money for repairs, Israel's restrictions mean he would not be able to import new machinery.

Even before the war, Al-Wadeya directed some of his Israeli suppliers to give up waiting for the Israeli crossings to open and ship their products to Egypt, then for them to be smuggled under the border into Gaza. "The main reason for all of this is to destroy the economic infrastructure of the weak Palestinian economy," he says. "They want to make sure that we will never have a state in Palestine."

Israel's military said it was conducting "post-operation investigations" into accounts of civilian casualties and property damage, but added that it "does not target civilians or civilian infrastructure, including factories, unless it is being used by the Hamas for terrorist purposes".

However, Palestinians, including al-Wadeya, disagree and argue that much of the bombing during this war was aimed directly at civilian infrastructure. Among the other targets hit were the largest cement factory in Gaza, the largest flour mill, the only parliament building, a major sewage project and the leading private school, not to mention the 21,000 homes and more than 200 factories completely or partially destroyed.

Al-Wadeya argues that Israel has allowed the commercial tunnel economy to function as part of a broader campaign to break Gaza's economic and political links with Israel and to force it towards a dependent relationship with Egypt. "During the occupation, from the beginning until now, our whole relationship is with Israel. You can't just break it and move towards Egypt," he says.

Some senior Israelis have spoken publicly in recent years of their desire to hand over responsibility for Gaza to Egypt, and to keep most of the Jewish settlements on the occupied West Bank while handing the remaining Palestinian cantons over to Jordanian control. Ironically, Hamas, with its insistence on opening the Rafah crossing with Egypt to give access to the rest of the Islamic world, appears at times to be pushing for the same future for Gaza.

The Islamists appear not to have grasped the full extent of the devastation suffered in Gaza, or the people's frustration. Shortly after the war, a Hamas official arrived at the rubble of the factory and offered £3,500 towards its repair. "I told him to get the hell out of here," says Al-Wadeya. "What would that buy? Not even new locks for the doors.

"I really believe that if we stay where we are with Hamas and Fatah and this political issue, we will never do anything in Gaza. It will become like Somalia or Sudan," he says. "We need two peaceful states, Palestine and Israel, living together. Without this we will be at war for the next century."

Going underground: a history of wartime tunnel systems

Afghanistan Tora Bora

Financed by the CIA and created by the mujahideen during the Soviet occupation of Afghanistan, the Tora Bora complex contains miles of tunnels, bunkers and fortified caves. Close to the White Mountain range near the eastern Afghan city of Jalalabad, the complex is where Osama bin Laden is believed to have hidden with 1,000 Taliban fighters. The caves and passages apparently have ventilation and power systems running on electric generators.

Gibraltar The galleries

Inside the Rock of Gibraltar is a honeycomb of tunnels known as the galleries. The first passages were built during the great siege in 1779-1783, when Spanish troops attacked the Rock. Soldiers from the garrison dug through the stone to a promontory on the north face, which allowed them to fire on the Spanish below. In total, 304m of halls, passages and openings were created. More tunnels were added during the second world war when the British feared Gibraltar would be attacked. The tunnel system was expanded and the rock became a keystone in the defence of shipping routes to the Mediterranean.

Bosnia Sarajevo tunnel

In 1993, citizens in Sarajevo began constructing a 1.5m high, 800m long underground passage. Their city was under siege from Serbian forces and the tunnel led to the UN-designated neutral area of Sarajevo airport. Bosnian volunteers worked in eight-hour shifts using picks and shovels to create a way for food, aid and weapons to come into the city, and people to escape. The tunnel was most famously used to transport the former Bosnian president Alija Izetbegovic in his wheelchair out of the city.

Vietnam Cu Chi and Vinh Moc tunnels

During the Vietnam war American soldiers came up against the Viet Cong's Cu Chi tunnels. This huge system of underground passages stretched from the Cambodian border in the west to the outskirts of Saigon, running below the jungles of Vietnam. Used to mount surprise attacks against US troops, the tiny tunnels led to subterranean rooms, some of which were big enough to be used as hospitals, arms stores and even theatres. The first passages were built during the 1948 war of independence with France to link villages. Later, the Viet Cong painstakingly expanded them by hand until they covered 250km. To attack the tunnels, the US created a volunteer force made up of soldiers small enough to fit down the passages. After negotiating hidden traps of sharpened bamboo spikes, they had to fight their enemy in the tunnels. The complex has now become a war memorial park.

Under the former demilitarised zone that ran between the communist north and capitalist south, lie the Vinh Moc tunnels. They were built to shelter people from the intense bombing of the area and included wells, kitchens, rooms for each family and spaces for healthcare. Around 60 families lived in them - and as many as 17 children were born inside.

Jersey War tunnels

Created during the German occupation of the island in the second world war, these tunnels were built by more than 5,000 slave labourers brought to Jersey. Many of the Russians, Poles, Frenchmen and Spaniards died of malnutrition or disease. Originally constructed as an ammunition store and artillery barracks, the tunnels were later converted to a casualty clearing station as D-Day drew nearer.

Poland Stalag Luft III

Immortalised in the film the Great Escape, Tom, Dick and Harry were the tunnels created by the prisoners of the Stalag Luft III camp in Poland. Work on the tunnels began in 1942 and during the night of March 24, 1944, 76 inmates managed to escape down a 101m tunnel. All but three of the men were recaptured; the Gestapo shot 50 and returned the remainder to captivity.

France Catacombs

Organised in a section of Paris's vast network of subterranean tunnels, the catacombs were a tourist attraction in the early 19th century. This cemetery covers a portion of Paris' former mines near the Left Bank's Place Denfert-Rochereau. During the second world war, both Parisian members of the French resistance and German soldiers used the tunnels.

Homa Khaleeli