Petra provided water and a safe place for lodging for Nabataean traders carrying incense, spice and perfume along two major ancient caravan routes. The demand for luxury goods in Rome, Greece and Egypt helped the city to evolve into a hub of culture and international commerce, according to the American Museum of Natural History.
Transporting goods from Arabia to these countries was risky and required expert knowledge of the desert, as lack of water was deadly. Water was available in the location that became Petra.
UNESCO says that building Petra into the sandstone bluff provided the city with natural protection from invaders. To provide further shelter, the citizens built a wall in front of the city. The formerly nomadic Nabataeans gained control of Petra and made it their capital, giving them control over the region. This allowed them to charge taxes and fees of those who passed through the area, as well as money for lodging and water.
The monies that the Nabataeans collected allowed them to expand Petra. They build elaborate tombs and temples. They built diversion dams and dug tunnels and channels which they combined with reservoirs and cisterns to control and conserve the rain that fell to meet the needs of the citizens and those they served.