Hierarchy of cities reflects the ubiquitous structure frequently observed in the natural world and social institutions. Where there is a hierarchy with cascade structure, there is a Zipf's rank-size distribution, and vice versa. However, we have no theory to explain the spatial dynamics associated with Zipf's law of cities. In this paper, a new angle of view is proposed to find the simple rules dominating complex systems and regular patterns behind random distribution of cities. The hierarchical structure can be described with a set of exponential functions that are identical in form to Horton-Strahler's laws on rivers and Gutenberg-Richter's laws on earthquake energy. From the exponential models, we can derive four power laws including Zipf's law indicative of fractals and scaling symmetry. A card-shuffling model is built to interpret the relation between Zipf's law and hierarchy of cities. This model can be expanded to illuminate the general empirical power-law distributions across the individual physical and social sciences, which are hard to be comprehended within the specific scientific domains. This research is useful for us to understand how complex systems such as networks of cities are self-organized.