I think the worries about military conflict are dramatically overblown. China does not have a record of large-scale military adventurism. In fact, since the Communist Party won the civil war, they’ve engaged in only very limited foreign wars, and none really since the 1979 incursion into Vietnam.
China has been in much, much worse economic and political turmoil since the Communist party took over, and did not feel the need to invade Taiwan or India during those times either. I think a lot of people buy into the myth of “fighting wars to keep the peasants quiet”, which is a canard that supposedly authoritarian regimes just do all the time to keep people quiet. I think it’s dramatically overblown as to both how often that happens and the scale of conflict when it does. While some sort of Nationalist saber-rattling ala minor clashes along the Kashmir border, or naval exercises in the South China Sea might steady support for a regime, a large full-scale war that could go sideways is a huge risk that could actually bring about the collapse of a regime. Remember the Argentine junta that started the Falklands War also fell shortly after because of that decision (and in part their miscalculation was just assuming seizing the islands would not lead to a large dust up with the United Kingdom.)
China knows that a serious war with India or Taiwan will be the biggest conflict they’ve been in since the Korean War, and unlike the Korean War where they were supporting an allied state, they would have their skin fully in the game with either of these wars. The escalation could essentially be infinite in magnitude.
Also at least with Kashmir, you’re not just rolling into India with a few brigades. If China was actually looking to fight a real war there you would see a massive mobilization on the Indian border, it can’t really be done covertly.
I do think the economic situation is very concerning as I already said. Western economists broadly believe that the government picking winners and losers and being heavily involved in the economy creates lots of waste and inefficiencies that hold back growth. That mostly has been borne out by historical example. It’s a fine line though, because there’s many examples where shrewd government industrial policy has reaped rewards probably not possible through a purely free market (see post-war German and Japanese industrial policy.)
Like @China_Guy said essentially since Deng the deal has been no political liberalization, but economic liberalization, let the party run the country, but we’re not going to get in the way of you making money. And hey foreign investors, we aren’t going to 100% open to whatever you want, but we’re willing to let you invest in our country, with some limitations, and make a lot of money here.
It’s mostly been a very profitable 35-40 years. I think the big threat is honestly that Xi and the faction he represents, believe this growth can be separated from some of the economic openness that went along with it. China has regularly “cracked down” on various things for years, but usually the crackdowns have tended to be more for show, and abate after a time. Xi has been steadily putting the screws to lots of private business activities, and also doing things that make China a less desirable country to invest in for foreign investors. This could see a real capital availability crunch for the Chinese economy, and could also stifle growth (the engine that has fueled the beast for the last 3.5 decades), if that stuff is starting to hit home at the same time as some other things like the real estate market potentially collapsing and other economic problems coming to fruition, it could be a pretty serious shock to the entire system and serious shock to the economic future of the country.
China’s growth from being essentially a quasi-medieval country in the early 20th century, to a more powerful one, was inevitable. It is not inevitable that China becomes a society where its people are as wealthy as first world countries, and many countries in the 20th and 21st centuries have struggled to ever fully complete the transition, or get out of the “Middle Income Trap.”