Bare rock wins. Against green valleys and flowing water, the empty desert hill often offered a better survival equation, because height and distance acted as a silent force multiplier long before any formal doctrine of military science existed.
Security came first. Elevated desert forts controlled line of sight, fields of fire, and approach corridors in a way no valley stronghold could match, using simple geometry of slopes and angles to stretch a few defenders into an outsized deterrent against raiders and organized armies alike, as attackers were forced uphill over open ground under missile range with no tree cover, no surprise routes, and no quick escape once committed.
Scarcity helped defense. On a barren hill, every visible path to water, pasture, and trade became a monitored choke point, turning access to wells and caravan tracks into a de facto moat that funneled strangers past watchtowers and gatehouses, while small cistern systems and groundwater capture let garrisons stockpile enough reserves to ride out blockades that would have starved a lush but exposed valley town dependent on broad, vulnerable irrigation networks.
Isolation was insurance. By sitting away from dense farmland, hilltop fortresses reduced the incentive for full annihilation, since an attacker who burned fields gained nothing but sand and stone, and this cost-benefit imbalance, combined with the sheer effort of hauling siege gear across arid plains, quietly pushed many would-be aggressors toward tribute, negotiation, or bypass instead of ruinous conquest.