system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What is the Background to the situation in Somalia today and the rise of Al-Shabab?

Was wondering the background history of Somalia and why groups such as Al-Shabab exist.
gpt
Basically: 

Somalia was in the Soviet sphere during the cold war. A strong Communist central government kept tribal conflicts in check.

End of the Cold War in 1990, without Soviet support the Communists almost immediately lose power to a rebel tribal coalition.

The country then degenerates into tribal infighting and factional conflict and pretty soon there's a full on civil war.

UN sends in peacekeepers, but you can't keep the peace when the entire country is comprised of rival armed militias. They get badly bloodied (events of Black Hawk Down) and pull out.

The Islamic Courts Union, of which Al-Shabaab was originally a junior member, emerges as the strongest faction and takes over most of the country. This was because Islam is the strongest unifying force in a country where Somali identity is secondary to tribal identities, and because political Islam has been in the ascendency all across the world since the Iranian revolution.

Post 9/11 the west realises that having Islamists controlling large amounts of territory provides the sort of safe haven for international jihadists that the whole War on Terror was about destroying.

So in 2006 America convinces Ethiopia, with the strongest army in Africa, to invade and restore the authority of the UN-recognised government, which by this point only controls a few blocks in the capital. Other African states contribute troops as well, like Kenya.

Al-Shabaab can't fight tanks with pick-up trucks so it switches tactics  to guerilla war and political terrorism, while still controlling much of the countryside. (a lot like in Afghanistan)

Which is basically where we are at the moment.