MOGADISHU, Somalia-- The withdrawal of Somalia's Al Qaeda-linked rebels from their bases in Mogadishu and severe food shortages in southern Somalia may be linked to the same problem familiar to politicians the world over: tax collections.

The abandonment of Mogadishu by al-Shabab puts Somalia's U.N.-backed government in its strongest position in years in a country where anarchy has reigned for two decades.

Somali drought victims who lived in territory controlled by al-Shabab say there was little incentive to plant surplus crops because the militants demanded so much of the harvest as a form of tax payment. Families had nothing to fall back on after drought withered this year's crops, so they were forced to flee to the government-controlled capital.

Meyrahow Hashi, a mother of seven who fled her farm in the Lower Shabelle region, said al-Shabab demanded half of a farm's output.

"Al-Shabab enforced the condition that you give 50 percent or your farm will be taken over," she said. "Tax men were always coming and threatening us. Then droughts turned the farm fields into ghost lands."

Somalis who once supported -- out of fear or conviction -- al-Shabab say high taxes, harsh punishments that often involved amputations and denial of food aid to famine victims have drained much support for the insurgency.

"How can you farm if the profits will be theirs?" asked Ali Gocoso, a former farmer also living in a hunger refugee camp. "Our labor was only profiting al-Shabab. We got nothing, except a few sacks they left to us."

Taxes were the insurgency's main source of revenue, according to a U.N. report, but al-Shabab has lost control of Mogadishu's biggest market -- Bakara -- and there is little left to tax in the famine-hit south. Al-Shabab's second-largest source of revenue, from southern ports it controls, has been unavailable since May because seasonal monsoons create seas too rough for the small ships that come.

Revolts in Arab nations may also have disrupted foreign donations, although these payments are harder to measure.

Even as the insurgents ran low on cash, foreign donors began regularly paying their enemies, Somali government soldiers. About 8,000 have received $100 a month since December.

Government troops are supported by 9,000 African Union peacekeepers, whose tanks and armored vehicles outgunned al-Shabab fighters in pickup trucks mounted with machine guns.

The insurgency has been steadily losing ground in the capital since last year. The AU and the government now control all of Mogadishu. Allied militias control a strip of land along the Kenyan border, areas near Ethiopia and parts of northern Somalia near the semiautonomous region of Puntland. The rest of southern and central Somalia is held by al-Shabab.

But the AU and the government didn't conquer the capital outright. The Islamists were still holding about a third of the city when they suddenly withdrew overnight. Al-Shabab said it was a "tactical withdrawal" and promised devastating suicide attacks. Those have not materialized, although car bombs have been found and defused or blown up before reaching their targets.

Somali expert Ken Menkhaus believes retreat was the best of a range of bad options for the insurgency.

"Shabab's withdrawal from most of the capital was certainly a sign of weakness but it was a very good tactic to make lemonade out of lemons," said Menkhaus.

By withdrawing, the insurgents are able to redeploy to protect their northern flank, simultaneously overextend the AU forces, expose the government's inability to hold and govern territory and set themselves up for hit-and-run attacks, he said.

The withdrawal has exposed the government's inability to prevent the theft of food aid or looting by its soldiers. But it also exacerbated long-standing splits between top al-Shabab leaders and between local and foreign fighters in the ranks.

Some Somalis complained that foreign fighters were given more privileges and pay than locals, said a Western diplomat. Many of the foreigners were contemptuous of the locals, with one foreign fighter referring to them as "monkeys in the desert," during a phone conversation, the diplomat said, citing intelligence reports. He spoke on condition of anonymity because he, like other diplomats interviewed for this story, was not authorized to speak to the press.

Senior al-Shabab leaders like Sheik Hassan Dahir Aweys, who formerly led a militia that fought al-Shabab before partly merging with it, and Rahanweyn clan leader Sheik Muktar Robow have to justify the loss of fighters to their clans and explain to starving relatives why they are denied food aid, said Menkhaus.

Diplomats hope the two may eventually turn against al-Shabab's two top leaders, seen as outsiders who disregard the suffering of local families. Fuad Mohamed "Shongole" and Ahmed Abdi Mohamed Godane, known as Abu Zubayr, come from the parts of northern Somalia not under the militia's control.

"These are the hard-liners who are imposing draconian policies on the local population and helping to exacerbate famine conditions," said Menkhaus.

The movement has not split but there has been an increase in the number of insurgent commanders seeking contact with the government, said two other diplomats. They described the talks as an insurance policy by commanders in case the government gains the upper hand.

It would be a mistake write off al-Shabab, said Matt Bryden, the head of a U.N. panel charged with monitoring an international arms embargo on Somalia. The group's precursor, the Islamic Courts Union, first came to power because its strict interpretation of Islamic law imposed some order on the country's chaos and corruption.

If clan warlords start fighting, or if the government fails to curb corruption, conditions would be right for the insurgency to regroup.

"Al-Shabab is elastic," said Bryden. "They can be stretched but so far they haven't broken."