He told his wife, Sarura, and their four children that they had to leave. In Bakool, Somalia, they packed some clothes and cooking pots and set out for Dadaab, the world’s largest refugee camp, on the edge of Kenya, a 200-mile walk to the south-west.

It took 28 days; all they had was a handful of rice and some black tea.

We meet them in a queue at the entry point to the camp.

'Four years ago she was very beautiful,’ Abdi says of his wife. 'She was fat. This is not the wife I married.’

Sarura is long-limbed with an oval Modigliani face. But hunger has made her stooped and drawn. The children look small, baggy and elderly. As a fully adult male Abdi is quite a minority here as most of the men are either at home in lawless Somalia, trying to protect what’s left, or have been killed.

Abdi is consoled by the thought that one day the hunger will go and his old wife will come back.

As we leave, they are being bundled into the husk of a Nissan truck, new pots and emergency rations lashed to the roof. Abdi’s brother, who arrived at the camp three months ago, has found them a pitch on the outskirts. The owner of the truck is a village elder with a Father Christmas beard.

This is one of the hopeful stories I hear in Dadaab. In another line is Sadia. She was violently uprooted from her home near Mogadishu during a shoot-out between proxy armies. Her mother and father were killed, and her husband disappeared.

She walked for 15 days with her nine children and some neighbours. On day six, they were attacked. Two of the women were raped. Sadia told her children to run. The women were unable to walk, so she left them behind.

Suddenly, even though Sadia is sitting opposite me, she can’t see me any more. She is fighting memories. She turns away, too scared to continue.

We just have time to beat the 6pm curfew and drop in on Save the Children’s Child-Friendly Space. It has the veneer of a playgroup back home, with tyre swings and make-a-mask workshops. In the quiet room is a display of children’s artwork: plasticine animals. I pick up a carefully crafted hyena.

'These are the things the children see on their journey,’ beams a helper, a pretty Kenyan woman with a giant smile.

I scan the shelf and see lots of snakes and a few lions. Then I’m struck by a naked woman with prominent buttocks and large breasts. 'Ah! This woman was gang-raped.’ The artist – the victim’s child – was probably seven.

The journey to Dadaab, it becomes clear, is like walking a tightrope across the valley of death. Girls are raped, even little ones from primary school.

'A third of our rape cases are against boys,’ Camilla Jones, a child protection adviser with Save the Children, says. 'That is just the reported cases.’

For Somali women and children, the price of rape is shame. 'We have to work on self-esteem,’ the helper says. It is possible to recover from extreme malnutrition in four to six weeks. But, you suspect, emotionally and psychologically, there is no recovery.

The March and April rains failed to fall across east Africa this year. The same thing happened last October/November, as it has virtually every other year for the past decade.

The drought has a foothold in three countries – Kenya, Ethiopia and Somalia – straddling the triangle of drylands where the countries meet. By early August, the UN Food and Agriculture Organisation said it was the worst drought in 60 years, and the number of people at risk from hunger was 12.4 million.

This has echoes of 1984 when a million people died in the Ethiopia famine. Many believe the death toll would be the same today were it not for the fact that there are now early-warning systems, more sophisticated treatment for malnutrition – such as the 'wonder snack’ Plumpy’nut – and schemes such as the Department for International Development’s £87.2 million Hunger Safety Net Project in Kenya, which helps people to feed themselves.

The problem is that for aid to work it needs a functioning government. And Somalia has lived without a functioning government for 20 years. Piracy is one symptom of this lawlessness. The other is the spread of Islamic extremism. In the early 1990s the fight was between clan warlords. A decade later, this became a struggle between warlords and militants advocating strict Sharia law.

In 2006 the more extreme Islamists formed al-Shabaab ('the Youth’ or 'the Lads’), a militia group with links to al-Qaeda. For the past four years, al-Shabaab has been fighting the official Transitional Federal Government (TFG).

Al-Shabaab now controls most of southern Somalia. In 2009 al-Shabaab started evicting aid agencies, including the World Food Programme (WFP), saying food aid created dependence and that the organisation was an enemy of Islam – 60 per cent of the WFP’s food is from the US. Later that year, the US cut about $50 million in aid funding, desperate not to allow any of its funds to get into al-Shabaab’s hands.

Meanwhile, the lack of rain last year pushed up food prices. With no government safety net and little or no aid getting in, people started going hungry. Hunger turned to starvation. In late July, the UN said 3.2 million people needed 'immediate life-saving assistance’.

The crisis has forced an exodus of people in search of a haven. But the choices are stark. There are almost 1.5 million displaced people in Somalia, and a third of them are living in camps in the capital, Mogadishu.

'They’re everywhere you look,’ says Cassandra Nelson, a director of Mercy Corps, one of the few aid agencies to have begun working openly in Mogadishu since August 12, when TFG troops ousted al-Shabaab. 'These people have nothing. They’ve plopped themselves down somewhere in the hope they will be near something and there isn’t much to be near. They don’t have access to clean drinking water. There are no toilets so they are going to the bathroom anywhere.’

There is cholera (181 people have recently died in one hospital alone, according to the World Health Organisation) and measles. 'In a 45-minute period I witnessed three children die in the hospital,’ Nelson says. 'It’s beyond imagination, the amount of pure human suffering I’ve seen.’

Dadaab was once a tiny town at the edge of nowhere. It’s a two-hour drive through grey desert to Kenya’s outer limits. It has always been a Wild West of bandits, carjackings and guns. The refugee camp was opened in 1991, with a capacity of 90,000; 20 years on, Dadaab is Kenya’s third largest 'city’, with a population of nearly half a million refugees (98 per cent Somali). Six thousand are third-generation – grandchildren of the original arrivals.

I meet Moses Mukhwana in his office on the UN Refugee Agency (UNHCR) compound, 20 minutes down the road from the camp, protected from the no-go area outside by a barbed-wire fence. As a project co-ordinator with the Lutheran Welfare Federation (LWF), the agency appointed by the UNHCR to run the camp, it is his job to plan Dadaab. He is 40, from Kenya, and trained as a teacher. He joined LWF last April, but has worked in the relief world for 13 years. He is a model of tact, restraint and compassion, on the edge of a precipice.

'I start receiving calls as early as 5am,’ he says. 'Sometimes I leave the office at 10 at night, sometimes I go beyond midnight. Sometimes I just have to close up and go, because you can break.’

The trouble is the camp is full, more than full. In 2009, when Mukhwana arrived, there were already 270,000 inhabitants, and 13 per cent were severely malnourished. There were 36,000 too few latrines and 40,000 too few shelters.

Then, between June and August this year, numbers increased by about 340 per cent. If you were to look at rates on a graph, the number would chart an ever-upward trajectory for years, and then when it hit June 2011, it would rise almost at a right angle. And they are still coming: on average 1,000 a day.

He points to his computer screen and shows me a map of the camp, which is sub-divided into three zones – Ifo (the oldest), Hagadera and Dagahaley. We fix on Hagadera. The surprise is how organised it is. A geometric pattern of blocks and sections, it reminds me of New York’s grid system. 'Yes,’ Mukhwana nods, 'it’s adapted from that, for sure.’

Each block contains 100 households; each household has five to six people; each section is made up of 10 blocks. The problem is that few refugees return to Somalia. And there are some parts of Dadaab that feel disconcertingly civic. Ifo, for example, has eight primary schools, two secondary schools, one adult education centre, 50 mosques and at least 150 imams.

It also has five 'markets’ – a collection of shops selling bicycles, biscuits, powdered milk, dates, spaghetti (Somalia was colonised by the Italians). 'Not all the refugees are poor,’ Mukhwana says. 'Some come in with resources to do big business here – they run big shops, for example – but the majority are in a needy state.’

Plots ran out in August 2008. New arrivals moved in with family or friends.

'The camp started swelling from within,’ Mukhwana says. Classrooms expanded from 60 to 120 children. By last October there was no more space in the camp. So people settled on the outskirts. 'It’s this area you see here,’ Mukhwana says, pointing off the map, to a space that is white and empty. Unofficial limbo. Tens of thousands are now gathered here, many of them ill. The set-up is even poorer, dirtier, more humiliating and dangerous than the camp itself.

There is hardly any sanitation. In order to cook, women need firewood, and if they go to the bush to get it, they risk being raped. Some of the long-term residents have goats; but the 100,000 recent arrivals lost their livestock in the drought. Water for the whole camp has to be brought in by tanker; there is barely enough for humans, let alone crops.

In the early 1990s, the department of the Kenyan government dealing with refugees comprised one person in the Ministry of Home Affairs; the responsibility for refugees in Kenya fell solely on the UNHCR. Kenya’s Refugee Act in 2006 saw the creation of the Department of Refugee Affairs (DRA) with a team of 30.

'Now the priority of this office is to be part of the movement but for the government to take the driving seat,’ says Emmanuel Moiabera, a UNHCR spokesman.

The DRA has since taken over the registration of refugees, while UNHCR works with agencies such as Save the Children and LWF to manage the camp. But there is a growing backlash against Dadaab, with locals, many desperately poor themselves, resenting the aid rations, healthcare and schooling.

In July, the Kenyan government finally agreed to open two new spaces: Kambioos and Ifo Extension, which was actually completed late last year, but was unauthorised for use. Each has a capacity of 90,000. 'The Kenyan government dragged its heels,’ one veteran aidworker says. 'Now, of course, with the world’s attention on it, it had to agree.’

'The target from UNHCR is to have moved all the people from the outskirts to the new camps by the end of November,’ Mukhwana says. Over­crowding isn’t the only urgency. If the rains come in October all of Ifo’s outskirts will flood. Dr Gedi Mohamed, the director of the Médecins Sans Frontières (MSF) general hospital at Dagahaley, has another worry. 'As long as people live in the outskirts with no proper amenities, it is very dangerous. If cholera strikes, it will be catastrophic.’

What happens if people keep coming over the border, I ask Mukhwana. 'We are hoping Somalia will return to normality and that will mean fewer people moving to Kenya,’ he says optimistically.

(I think of Cassandra Nelson’s latest email: 'Here in Mogadishu the situation has gone from bad to worse… the hospitals have seemingly double the number of patients as last week. Many patients are sleeping outdoors around the hospital.’) 'Because definitely Kenya will get into a situation where it can’t take any more,’ Mukhwana continues.

The next morning I am interviewing a refugee with Shafi, my translator. He is verifying all the stories we have ever heard about Somalia – 'prolonged drought, no food, no water, they came on donkey carts…’ – when he starts yawning. From a teacher and a manifestly nice man, this seems tactless. But the truth is he was up early, praying. It’s Ramadan, the month of fasting, when Muslims abstain from food and drink from dawn to sunset. Even the starving newly arrived, I am told, are fasting (those who travel more than 14 miles a day are exempt, according to the Koran).

The main feature of life at Dadaab is queuing. It starts when you arrive, and you are sorted into neat lines – large families (the template goes up to 17 children), small families, women- and men-only (Somalis prefer segregation). Today the queue at Ifo reception is already 500-long.

Once through the gate, refugees will be fingerprinted, wristbanded and weighed, and will collect emergency rations to last 21 days: a scoop of maize flour, salt and split yellow peas. (Those marked 'priority’ are fast-tracked to another queue to be fed high-energy biscuits.) Within the next three weeks, on an allocated day, they will queue outside the Registration Centre, to become official refugees and get a ration card, and, thereafter, twice-weekly food distributions.

I meet one woman in the line for MSF’s clinic for the severely malnourished, in the outskirts of Dagahaley, who is still queuing from the day before. Her baby is asleep in a shawl wrapped around her back. The baby’s sleep is much too still. This is the kind of detail visitors to Dadaab pick up, in the way that tourists pick up information about bus timetables. You learn that malnutrition has a 'flat effect’ – children stop playing or moving about. To keep going, the body starts consuming itself – going for the protein in muscles. We know about distended bellies (the result of bacterial overgrowth in the gut) from television, but starving children also have burn-like lesions on their skin, and a 'flaking paint’ type appearance. Hair becomes brittle, easy to pull out, and tinged with red.

There is an equation to work out a healthy child’s weight: 2a + 8 (2 x age + 8). At the clinic a nurse tests it out on Saahara, two, and Leyla Ibrahim, seven months, who lie next to their mother, Khadija, trying to cry but making no sound. Saahara should be 12kg but is 5.8; Leyla Ibrahim, should be 9kg and is 4.4. Their entire metabolism is in meltdown. This is life so close to death.

In 2008 Oxfam declared Dadaab a public health emergency. Cholera and other epidemics succeeded each other because of lack of medical care and hygiene. The water system, not updated in 18 years, was condemned as inefficient. Human Rights Watch severely criticised the agencies running Dadaab, saying it resembled a ghetto more than a refugee camp.

The drought is what is known in the aid world as a 'slow-burning’ crisis. Agencies issued warnings last year, but in early July it blew up and shot around the world, stirring everyone into action too late. The influx of refugees was matched by an influx of journalists, donor delegations, politicians and celebrities. There are now 1,022 aid workers from 22 agencies living on the UNHCR compound. Every morning, at 7.30am, 4x4s painted with 2ft-high initials – UNHCR, Norwegian Refugee Council, FilmAid, LWF, WFP – set off in convoy to the camp and return again at 4.30pm.

Ibrahim (not his real name) ran away from Mogadishu with his parents when he was four, in 1992. The family moved into Ifo, believing they would be going home shortly. They have been here ever since – except for his father, who returned to Mogadishu in 1998 to look for work, and was killed in a clan shooting. After his death, Ibrahim’s uncle in America sent $100 a month to support the family of seven. In 2010 Ibrahim won a scholarship to study for a diploma at the Kenya Institute of Social Work and Community Development College in Nairobi. Now 26, he earns 9,000 Kenyan shillings (£60) a month working for one of the agencies, and is the main breadwinner for his family.

Anap Abdullahi Kariye, 45, who has lived here for nearly 20 years, is also earning money thanks to a scheme set up by Save the Children. An attractive, open-faced woman and already a mother of seven, she is now fostering eight other children, including five from the same family.

'They were attacked by bandits, and the mother disappeared with the baby. The father was captured by al-Shabaab three years ago.’ She says she spotted them at the reception centre three months ago. 'They’d been beaten, their clothes stolen. They were suffering, vulnerable children who didn’t have anyone to care for them.’

Through income-generation programmes, she borrows money from the businessmen in the camp, buys food, and then sells it in the market, sharing the profits among the 15 other foster parents in her co-op. 'She’s getting around $50 a month,’ a social worker says. 'The average cost of living per family on the camp is almost $250 a month [significantly less for smaller families], so it’s not enough for a living, but she gets some aid from other agencies.’

Jobs at Dadaab are limited. Kenyan authorities allow refugees to enter the country only on the agreement that they 'all must reside in designated camps’. Refugees are not allowed to work in Kenya; those who do work within the camp are paid a wage lower than the market rate.

'Countries bordering on war zones prefer to keep the floods of refugees that inundate them in one place, in a camp, in the hope that one day they’ll go home,’ explains Linda Polman in her book The Crisis Caravan: What’s Wrong with Humanitarian Aid? So refugees find opportunities elsewhere.

In 2009 Human Rights Watch confirmed fears that men and boys at Dadaab were being recruited both by the TFG and al-Shabaab to fight in Somalia. Many recruiters to the TFG promised an initial payment of $4-600 for the training itself, to be followed with a generous monthly salary on deployment to Somalia. 'Permitting recruitment of fighters in refugee camps undermines the very purpose of the camps – to be a place of refuge from the conflict,’ Georgette Gagnon, the Africa director of Human Rights Watch, said.

'Being warehoused, hanging about in camps with nothing else to do, can generate frustration and resentment,’ Polman continues. 'Afghanistan’s Taliban movement, for example, was born in Afghan refugee camps in Pakistan.’

Dadaab poses a conundrum: how do you treat a humanitarian emergency that does not go away? The question has created a political Catch-22, admits Catherine Fitzgibbon, the programme quality director for Save the Children in Kenya. 'Humanitarian officials say building schools and hospitals is the best way to protect refugees, but donors are hesitant to finance projects that will encourage more refugees to come and stay.

'But education is something that will actually provide the refugees with some long-term solution because educated people find their own way out.’ Save the Children wants to set up teacher training facilities in Dadaab for both locals and refugees.

Late afternoon, I find Sarura sitting on an upturned bucket, near her new home on the outskirts of Ifo. Home, in its refugee camp mutation, is a wigwam dome of dry sticks lashed up with plastic sheeting. She’s ill. Her slight frame looks feeble, her voice is barely there. A storm is coming. You can tell by the wind. What has she done today? Nothing, she says, just sitting. Is she happier here? She smiles very faintly, as someone hands her a crying baby to feed. 'Where else can I go?’ she replies, with a shrug. 'I cannot go back to Somalia.’