Like all ancient Chinese dynasties, the Tang Dynasty was a monarchy, ruled by an all-powerful emperor since it was founded by the ancient Li family in 618. Li Yuan was the first emperor of the Tang Dynasty. His rule initiated several centuries of economic prosperity and cultural vibrancy.
One of the factors of success of the Tang Dynasty governing system was the reforms it instituted by modifying and building upon the Sui legal code. This was an exacting, complicated, yet simple-to-understand set of laws that were very specific about what was basically allowed in Tang society, what was a crime, and what individual punishments were for violating the legal code. In short, everyone knew the score.
The Tang Dynasty government had three basic departments that created policies and laws. These frameworks of laws were administered by six ministries, which were personnel administration, military, finance, rites, justice, and public works. This super-efficient system of government worked so well, it outlived the Tang Dynasty itself, which crumbled in 907. The Tang system of government was the model upon which all subsequent dynasties based their own systems, and it was also used by other countries and kingdoms, such as those in Vietnam and Korea.
Another factor for the success of the Tang Dynasty system of government was the emphasis on education. The Tang rulers felt that a well-educated public was not a threat to authority, but rather, a foundation of a stable, prosperous society. Another feature of the Tang Dynasty government was its obsessive record keeping and accounting of many aspects of life and commerce. This naturally created deep layers of accountability and certainty, which bolstered the strength of the government and society.
But even the best designed systems of government have their flaws, and the Tang Dynasty eventually collapsed for a variety of complex reasons, some of which had to do with plain old bad luck, such as the occurrences of natural disasters. But internal corruption and incompetent rulers also hastened the demise of the once mighty Tang Era in China.