For example, in my neighborhood country DRC, there all kind of minerals that are used to build every tech product. You guess why EU and USA needs to keep a good relationship with the warlords there? In Somalia, I think it is a question of terrorism. The state of lawless that come with the downfall of Somali in 1991 made the country being prone to warlords running the country, even the seas. You remember how they used to take hostage of ships passing through the Red Sea. You better pay warlords or they will come back and take hostage tankers and stuffs.
In the end, maybe they came to the conclusion that it's better to buy peace with money than to deploy US/EU troops ( now there are African Union troops in Somalia assisted by US units).