Egypt, Syria, Iraq, Sudan, Yemen and Somalia all share a red, white and black flag, with markings on the white part. Yet, Jordan, Kuwait, Palestine and UAE all have a combination of black, white, red and green.

Is it just a coincidence that many of their flags are alike or does it represent something?