Marib lies at the edge of a desert - and has done since the climate changed around 3000 BC. Yet the civilisation of the Sabaean people of South Arabia was based on agriculture. How? By sophisticated control of the available water. Structures to optimise water utilisation have been found dating from around 1700BC. The Great Marib dam, dating from around 700 BC - originally an earthwork, but later reinforced with re-cycled stone and whatever building material was available (including stone from temples of the old gods superseded by conversion to monotheism: these are the works visible today)- was 680m across, spanning the Wadi as-Sidd. The Wadi is dry for most of the time, but twice a year it flows fiercely with flood-water. The idea of the dam was not to store this water as modern dams do - but to control it, calming the destuctive force of the river in spate, and allowing it to flow through channels on to the agricultural land below the dam. It's estimated that 10,000 hectares were made fertile by the Marib dam, supporting perhaps 50,000 people.
The dam worked by raising the water level - which meant that, because of silting, the structure regularly had to be made higher. Eventually, this was no longer possible. It was repaired for the last time in AD 549, after the conquest by the Christian Ethiopians, but was finally breached in the 7th century - an event mentioned in the Koran.
For more about Yemen (Arabia Felix) go here; for the political situation in the 6th century (the proxy war between Byzantium and the Sasanians, invoving Christian Ethiopians and Jewish Himyarites go here.