Kenya's military intervention in southern Somalia marks an important and hazardous moment for African peacekeeping. It will boost the beleaguered Somali government in Mogadishu, at least in the short term, and may bring limited relief to the famished local population. But despite their superior firepower and command of the skies, Kenya's armed forces may struggle, like the Ethiopians and Ugandans before them, to decisively defeat the al-Qaida-linked militants of the hardline al-Shabaab Islamist militia whose depredations prompted the incursion.

Nairobi's decision to send in its troops is not altruistic. For Kenya and other neighbours, not least fragile Yemen, the failed state that is Somalia has become a vortex of instability, suffering and terror that radiates ever outwards to affect all those within its orbit, even hundreds of miles out to sea. There have been cross-border operations before. But this ground intervention is on a grander scale, similar in some respects to Ethiopia's in 2006.

It's a wonder it did not come sooner. Kenya has reluctantly become home to the world's biggest refugee camp, at Dadaab, where 460,000 displaced Somalis have taken refuge from war and famine. Kenya's $750m-a-year tourist industry has suffered a sudden, catastrophic decline since al-Shabaab shifted its focus south and turned its guns on western visitors and aid workers. Last month a British woman, Judith Tebbutt, was taken hostage after her husband, David Tebbutt, was shot dead. And last week fighting erupted on the Somali-Kenyan border, giving a land-based dimension to the chronic problem of Somali piracy in the Indian Ocean.

After the kidnapping of a handicapped Frenchwoman, Kenya's interior minister, George Saitoti, said the situation was unsustainable. "This is a serious provocation on Kenya's territorial integrity by the al-Shabaab with negative effects on the tourism industry and generally also on our own investment," he said. Saitoti said those who thought they could provoke Kenya "have made a big mistake". But now, under domestic and international pressure to take firm action, the Nairobi government is biting back.

The idea that al-Shabaab has deliberately sought to widen the conflict is probably mistaken. More likely it is the result of weakness and fracturing control within the militia. Al-Shabaab forces largely pulled out of Mogadishu in August. They said it was a tactical withdrawal but it was more likely the product of pressure from Somali government troops and the UN- and African Union-backed peacekeeping mission, Amisom – plus growing public hostility. A random suicide bombing on 4 October that killed dozens of people in Mogadishu suggested al-Shabaab had again declared war on the capital's inhabitants.

Tougher international enforcement action to curb piracy may have contributed to forcing al-Shabaab on to the back foot. It has also reportedly been weakened by internal disputes, not least on how to manage the severe famine that is ravaging the central and southern Somali regions under its control. Some militants believe western aid agencies should be excluded altogether, despite the famine victims' urgent need of assistance and al-Shabaab's inability to provide it.

It is impossible to know what impact the ongoing, shadowy war waged against al-Shabaab and other al-Qaida affiliates by the US Africa Command base at Camp Lemonier in Djibouti is having – but it may be a contributory factor in terms of the militia's current difficulties. Suffice it to say, the increased number of attacks mounted by unmanned US drones in Yemen, just across the Gulf of Aden, has almost certain parallels inside Somalia. The US has another keen concern, too: the reported concentration and training under al-Shabaab's banner of foreign jihadists from south Asia, Europe and even North America.

Under Barack Obama, US policy has in some ways aped al-Qaida, showing a reciprocal lack of respect for sovereign borders and international law when "legitimate" targets present themselves for elimination. This unpromulgated Obama doctrine appears to apply equally to Pakistan-Afghanistan, Libya and the Horn of Africa.

In a parallel but nonetheless surprising move announced last week, Obama sent 100 US special forces combat troops into South Sudan and the Democratic Republic of the Congo to combat Lord's Resistance Army rebels. Their ostensible role is to provide advice. Where this may end is anybody's guess. For the record, the US has always denied sending special forces into Somalia.

Having taken the plunge, the Kenyan government is not expected to try to occupy swaths of southern Somalia indefinitely. Regional experts suggest instead that Nairobi will seek to support Somali government forces and equip and arm local militia antipathetic to al-Shabaab. There has been talk in the past of creating a buffer zone inside the Somali border, much as the Israelis did at one time in southern Lebanon and the Turks say they might do in northern Syria.

But the risk remains that the Kenyans get bogged down in hostile territory, a fate that has befallen better-trained armies than theirs. Al-Shabaab leaders on Monday declared a holy war against Kenyan forces and vowed to throw them back across the border. The Kenyan public now also faces the prospect of terrorist reprisals. In July last year, al-Shabaab killed 70 people in Kampala in a bombing intended to punish Uganda for sending peacekeeping troops to help the government in Mogadishu. Nairobi could suffer a similar fate.

All the same, and whatever its reasons, Kenya's decision to step in is a brave one that should be supported by western powers at a collective loss over what to do about Somalia. Like charity, effective peacekeeping begins at home. And African countries that step up to tackle an African problem, rather than sitting back and then complaining when the west tries to do it for them, are to be applauded.