They actually did not. In the pre-colonial period, the Ottoman caliphate ruled that region but they always placed an Arab from the family of the Prophet (SAW) in charge. They've always put a Hashemite as the 'Sharif' of Haramayn.Some of the royal families existed before the colonial times