Usually a dictatorship creates a border crisis when there are growing internal problems or strife. From what I am reading, the debt levels in China are at record levels. People are speculating on real estate and other hard assets. The crash when it comes may not be pretty.
Another possibility is that China was not expecting any strong response from India. Now that India does not appear to back down easily, they decided to turn this into an opportunity to show how their modernized military will perform in a real combat. If it goes hot, we may see some parallel to the initial phase of Russia's Syria operation in 2015. They may bring all fancy toys such as AWACS plane and cruise missiles launched from far away. A kind of overkill for a local conflict.
If things go their way, it would boost Xi's standing when Chinese regime will have their big party conference this fall where major shuffling of power can happen.