Established possibly as early as 312BC as the capital city of the Arab Nabataeans, it is a symbol of Jordan, as well as Jordan's most-visited tourist attraction. It lies on the slope of Jebel al-Madhbah (identified by some as the biblical Mount Hor) in a basin among the mountains which form the eastern flank of Arabah (Wadi Araba), the large valley running from the Dead Sea to the Gulf of Aqaba. Petra has been a UNESCO World Heritage Site since 1986.
Pliny the Elder and other writers identify Petra as the capital of the Nabataeans and the centre of their caravan trade. Enclosed by towering rocks and watered by a perennial stream, Petra not only possessed the advantages of a fortress, but controlled the main commercial routes which passed through it to Gaza in the west, to Bosra and Damascus in the north, to Aqaba and Leuce Come on the Red Sea, and across the desert to the Persian Gulf.
Excavations have demonstrated that it was the ability of the Nabataeans to control the water supply that led to the rise of the desert city, creating an artificial oasis. The area is visited by flash floods and archaeological evidence demonstrates the Nabataens controlled these floods by the use of dams, cisterns and water conduits. These innovations stored water by prolonged periods of drought and enabled the city to prosper from its sale.
I have seen several documentaries about Petra and have never failed to be amazed how the people built this city in rock and also controlled their water supply. There is a lot more information on Wikipedia if you are interested, far too much for me to include here. Petra at night: