The decision of constructing such magnificient buildings had to be supported and initiated by the Emperors. Looking back to the past history, the Forbidden City was constrcuted under the rule of "ChengZu" of the Ming Dynasty, while the Palace of Versailles was built in the regime of Louis XIV, the Sun King.
Such massive programmes of construction required huge sum of inputs of capital and labour. Because the palace is the residence of the King, common people cannot enjoy the "fruit" after their participation in construction work. People have to adsolutely obey the imperial will and support the dynasty so that the construction programmes can be completed without any resentment. Besides, the government must be rich enough to put large sum of money into the work. In brief, the national power of a country must be strong if it is going to support the completion of large royal architecture. According to history, the regime of both Emperor Chengzu and Louis XIV reached the zenith of their dynasties, the Ming Dynasty and the Bourbon Dynasty respectively.
The power of the Emperor Chengzu is presented by the King's direct control of six offices of "吏" (the affairs of civil servants), "戶" (inland revenue), "禮" (education, culture and examination), "兵" (national army), "刑" (law and prisons) and "工" (construction of infrastructure in the nation) after the abolition of the Prime Minister. He also initated the seven maritime expeditions by sending envoys to the countries in South-east China, Arabia and East Africa with thousands of fleets so as to spread the national prestige of China over the world. Under his rule, the Ming Dynasty reached the peak of strength, then declined after his death due to the serious corruption in the Government, the foreign threat posed by the Mongols and Manzus, nation-wide natural disasters etc...
Louis XIV is famous for his rule in France. He successfully kept all the Princes and Lords at his court in Versailles to have better supervision. He was also regarded as the most powerful and opulent monarch in Europe since the Roman Empire. France was become the strongest nation and the centre of Europe by his rule of carrying out the administrative and finanical reorganization, developing the trade and manufacturing industry, reforming army and encouraging the surprisingly rapid development of culture and science. His regime was seen as the Century of Louis XIV and the kingdom was at the zenith before the decline in the regime of Louis XV and the outbreak of the French Revolution.
It is obvious that the Forbidden City and the Palace of Versailles, two magnificient palaces in the human history, were constructed under the peak of the power of their nations. Their completions were also due to the background, with huge input of labour and capital under stable and properous political situation.