Why did city states emerge in East Africa?

Mombasa, Gedi, Pate, Lamu, Malindi, Zanzibar, and Kilwa were all city-states in East Africa that participated in international trade from 1000 to 1500 CE. They arose as city-states from small agricultural centers that intensified their agricultural production and grew in power accordingly.