A new book by two veteran journalists offers insights on the birth of al-Shabaab and infighting among factions of Somalia's Islamist insurgency.
"Inside Al-Shabaab" also assesses the group's prospects in the years ahead, with Voice of America (VoA) reporters Harum Maruf and Dan Joseph concluding that Shabaab will likely retain its ability to destabilise Somalia.
Mr Maruf, a senior VoA editor who has covered Somalia for 25 years, and Mr Joseph, VoA's Africa desk chief since 2005, base their findings primarily on interviews with more than a dozen Shabaab defectors, including the group's former deputy leader.
The 323-page book published in the US by Indiana University Press also relies on interviews with Somali government officials and expert analysts, along with State Department cables posted online by WikiLeaks.
Much of the content relates to events that will be familiar to longtime observers of Al-Shabaab.
Accounts of the catastrophic attacks on Kenya's Westgate Mall, Garissa University College and the KDF's base at El Adde in southern Somalia present little new information.
"Inside Al-Shabaab" likewise ignores a momentous 2014 finding by United Nations experts that KDF units collaborated with Shabaab in circumventing the international embargo on charcoal exports from Somalia.
The authors fail to provide a complete picture when they assert that as a result of Kenyan forces' capture of the port of Kismayo in 2012 "Shabaab lost its number-one source of funding."
But the book does illuminate al-Shabaab's origins by tracing the influence of Ibrahim Jama Me'aad, a key behind-the-scenes founding figure.
A native Somali from a religious family, Me'aad traveled in 1988 to Afghanistan where he became an associate of Osama bin Laden who was then helping lead mujaheddin resistance to the Soviet invasion.
Me'aad became so devoted to al-Qaeda's cause in Afghanistan that after returning to Somalia he became known as Ibrahim al-Afghani.
As a propagandist for jihad, al-Afghani was instrumental in the formation of a militant Islamist organisation in Somalia that, due to its large contingent of teenage and young-adult members, came to be referred to as "al-Shabaab" (Arabic for "the youth").
With Somalia wracked by civil war in the 1990s following the overthrow of dictator Siad Barre, Shabaab formed an alliance with another new Islamist movement that was focused on bringing justice and order to communities convulsed by lawlessness.
Militants of the Islamic Courts Union (ICU) joined Shabaab fighters in successfully battling a grouping of warlords funded by the CIA.
By 2006, the ICU had become strong enough to function as a de facto governing force in Mogadishu.
Shabaab, however, had come to view the Courts Union as insufficiently devoted to fundamentalist tenets, the authors relate. But many residents of the Somali capital did welcome the ICU as a guarantor of peace and stability, the book adds.
Islamist control of the capital proved short-lived. Feeling threatened by the Islamists' advances into western Somalia, Ethiopia invaded the country despite initial misgivings on the part of the United States, the Ethiopian regime's most important ally.
The invaders seized Mogadishu in December 2006 and helped secure Somalia's fledgling Transitional Federal Government.
The ICU's ouster from the capital led to its demise, but Shabaab grew in strength as the focal point of nationalist resistance to an occupying army.
Recruits flocked to the group, enabling it to become a powerful fighting force. Under the leadership of Ahmed Abdi Godane, who had developed close ties to al-Qaeda during time he spent in Pakistan, Shabaab grew so potent that it nearly overthrew the US-backed transitional government in 2009.
Shabaab also ruled most of Somalia at that point. As an Islamist force that attempted to govern territory where it could not be effectively challenged, Shabaab can be likened to the Taliban in Afghanistan and differentiated from Boko Haram in Nigeria, the authors suggest.
Godane is portrayed in the book as a skillful military leader and an ideological extremist -- even by Shabaab's fanatical standards. The group's strict enforcement of its version of Shari'a, along with its propensity for killing Muslim civilians, made it increasingly unpopular in some of the areas it governed. Godane's style of leadership simultaneously earned him numerous internal enemies, the authors recount.
He took pre-emptive action against perceived threats. In 2013, for example, Godane's security unit assassinated Ibrahim al-Afghani, who had remained an influential figure inside al-Shabaab.
The authors describe al-Afghani as the group's chief media strategist, a respected teacher of Islamist precepts and a valuable liaison to the heads of clans in a society divided along those lines.
Al-Afghani, the authors write, "had planted the seeds for jihad in Somalia and spent nearly a quarter of a century growing and shaping their violent, extremist fruit."
Godane was himself killed in a US airstrike in 2014. The Pentagon described his removal as "a major symbolic and operational loss to the largest al-Qaeda affiliate in Africa."
Many analysts predicted at the time that a decapitated Shabaab would now splinter into fragments that could take up arms against one another.
But the group has once again proven resilient, with an ability to quickly replace fallen figures and retain internal coherence and discipline, the book points out.
Shabaab's broad political and military control in Somalia in 2009 probably marked the group's zenith, the authors suggest.
There is now little likelihood of al-Shabaab ousting the federal government and defeating the African Union military mission (Amisom) that props up the nominal authorities in Mogadishu.
But the jihadis have transformed themselves into a highly dangerous guerrilla army that may prove impossible to eradicate, the book notes.
"Add it all up," the authors write, "and it's fair to say that Somalia's prospects for peace and stability look only marginally brighter than they did on the day Amisom arrived on Somali soil in 2007."