How Afroasiatic lanaguges are connected is honestly incredibly mysterious. You have lots of linguists who say berber and semetid branches are closer. But we have no idea how that would even physically be possible. Theres also no real explanation for where eygptian came from.I have come to the realisation [many] words found in Somali, which are also found in Arabic are nether loan words nor borrowed, but share the same linguistic root.