Well, it might surprise you but Indian leadership was actually napping despite the regional hostilities. Nehru was working on “Hindi Cheeni Bhai Bhai” while the Chinese were making military preparations. Similarly, Pak was also not seen as a threat (big mistake). The situation was repeated by Vajpayee in 1999 with the bus trip & other peace overtures towards Pak, while Pak was planning Kargil. Luckily we were much better off militarily in 1999 compared to 1965 and that helped us.
Pak tried to use local support in Kashmir in 1965 to defeat India, but that plan backfired. India used that same tactic successfully in 1971. As they say what goes around, comes around…
India cannot match up to China in conventional military prowess. The Chinese economy is a lot bigger, and they spend a bigger chunk of their GDP on defence spending. However, China realizes that India will not be a push over in a war and a war with India would cause a great loss to the Chinese economy. So for now, I dont expect China to initiate open hostilities.