By the 2nd century BC, Petra had become a huge city encompassing around 10 kms, and was the capital of the Nabataean Kingdom.
Primarily, the Nabataeans were farmers. They cultivated vines and olive trees and bred camels, sheep, goats and horses. They were skilled at water management and built a complex network of channels and cisterns to bring water from a plentiful source at Ain Musa several kilometres away, to the centre of the city. But their main wealth came from the fact that Petra was an important hub for the lucrative trade routes that linked China in the east with Rome in the west.
Caravans laden with incense, silks and spices and other exotic goods, would rest at Petra, which offered a plentiful supply of water and protection from marauders. In return for their hospitality, the Nabataeans imposed a tax on all goods which passed through the city and grew wealthy from the proceeds.