Analysts say Islamabad is seeking to strengthen ties with Beijing while navigating relations with the United States and Iran.