The Indiana Jones writers took some liberties, though. I've always operated under the assumption that this was the only structure in the canyon. Turns out, though, that this is the treasury building, and that there was an entire civilization that lived down here (The Nabateans). It also turns out that there used to be a lot more relief work on this facade, including large decorative vases. There was a local legend, though, that the vases were filled with gold coins, so the locals took to shooting at them with guns.
Like every other civilization in the region, the Nabateans were eventually conquered by the Romans, who then installed an amphitheater, shown below:
To get to Petra you walk (or ride a horse) down a canyon. Along the way there are many structures carved out of the rock:
As well as rocks that look like animals:
You're probably wondering how a civilization managed to survive and thrive, given the desert conditions (well, unless you've read a lot of Dune). They were rigorous about gathering and keeping water. Throughout the canyons there are these channels, set up to direct any rain water to reservoirs:
There's also beautiful patterns in the sandstone: