Answer by Akshay Jain:
China has been traditionally a good friend of Pakistan to have an edge on India.This works good for both Pakistan and China as India will always have to make war moves considering an attack from both sides.
This would thin our lines and give them an edge.
There are many other reasons.
1)China does not have allies as it has problems with all its neighbors(Vietnam,Japan,Singapore etc).Pakistan comes as a good ally that also helps it make connections with the Muslim world.
2)China gets access to ports likethat lets it build "bases" across the Indian Subcontinent.
3) In a situation of war the Indian Navy can cut off the oil that China gets from the naval route.
This would make Chinese military to stop its expansion and bring it to a halt. They are now building a pipeline that would enable them to get oil through Pakistan. This also explains many Chinese investments in the POK.
If you think about it Pakistan is getting a lot of money just because of the borders it has.From China because of India and from the US because of Afghanistan.
Hope this helps.