I think the main reason is that the Qing government adopted a closed-door policy, which led to ignorance of the outside world. The current rulers don't know that the external situation has changed greatly. They still claim to be a great country and consider themselves the center of the world.
Abroad, especially with Britain's transition from feudal society to capitalist society through the industrial revolution, the establishment of political constitutional monarchy provided a good guarantee for the development of capitalist economy and played a protective role for British businessmen to colonize the world.
the opium war
Facing the huge market of 40 million RMB in China, the British people will naturally not let it go. So after several friendly consultations with the Qing government failed, Lin Zexu launched the Opium War on the pretext of destroying opium. Since then, China has gradually become a colony of western powers, and the decline of the dynasty is the general trend.