Pakistan leaned pro-China since the 1960s after Ayub Khan normalized relations with China over Aksai Chin and Pakistan helped negotiate the Sino-US Pact, but fully pivoted after Zulfiqar Ali Bhutto became PM, as he had a good working relationship with Mao [4]
The Pakistani nuclear program was jumpstarted by PLA technology transfers in the 1970s [0][5], Pakistani Tank Technology like Al-Khalid are results of PLA tech transfers in the early 1990s [1], Pakistan began adopting Chinese fighter jet IP in the early 1990s [2], and the entire indigenous missles program in Pakistan began thanks to Chinese IP transfers in the 80s [3]
The US-Pakistan relationship was always transactional and surface level. Chinese SOEs would at least invest in Military affiliated companies like Heavy Industries Taxila, Pakistan Aeronautical Complex, Khan Research Laboratories, Global Industrial Defence Solutions, and National Defence Complex
The countries in the list abovr had a relationship with the US that was similar to that between China-Pakistan, but began pivoting away from the US in the 2010s.
[0] - https://www.jstor.org/stable/41394229
[1] - https://www.dawn.com/news/1217909
[2] - https://web.archive.org/web/20121021154725/http://www.flight...
[3] - https://web.archive.org/web/20081007232310/http://www.wiscon...
[4] - https://www.nytimes.com/1972/02/02/archives/bhutto-confers-w...
[5] - https://nsarchive2.gwu.edu/NSAEBB/NSAEBB114/