On the Origins of Hierarchy in Complex Networks