Pressure on India
Chinese Industry competes with Indian industry.
The two countries dispute territory. The yellow areas are all disputed. Maps in India and China each show the Pradesh territory as part of their own country. Interestingly, Google Earth shows a different border line on this territory depending on where the user is. In the Sino-Indian war, in 1962, Pakistan verbally supported China.
So having the largest nation, Pakistan, on India's other side as an ally has advantages. What if in the future China shut off certain trade to India? Having other neighboring countries on their side would help.
Secondly, Pakistan has made an effort to be friendly to China for some time. The two countries have a lot of trade. China's main cotton source was Pakistan for a long time.