The trip to a remote mountain location in the north of the country came on the third day of the royal tour.
The duke and duchess were shown how the Chiatibo Glacier had retreated rapidly in recent years due to global warming.
Prince William said communities “vulnerable to change” needed more awareness of climate change.
The duke said young people were “starting to get engaged”, adding that a “positive conversation” around the issue was needed.
The couple arrived by helicopter to the Hindu Kush mountain range in the Khyber-Pakhtunkhwa province.
On their arrival Catherine was presented with a traditional Chitrali hat – almost identical to one William’s late mother, Diana, Princess of Wales, received on a visit to the same region 28 years ago.
The duke was also presented with a book commemorating his mother’s trip to Chitral in northern Pakistan in 1991.
Global warming has seen the Chiatibo Glacier in Broghil National Park retreat by some 10 metres a year due to higher temperatures melting the ice.
The first threat from the glacier melting is flooding to communities down stream, while the second is removing the water supply completely – which provides for 200 million people in Pakistan.
Glacier expert Dr Furrukh Bashir said he hoped the duke and duchess’ visit would raise awareness of the issue.
Following their trip to the glacier, the couple remained in the region to meet with communities affected by global warming.
The couple visited Bumburet, which was destroyed by flooding in 2015.
They also watched an emergency response drill, which included demonstrations of how members of the community carry casualties over a river.
In a speech on Tuesday evening, William urged the UK and Pakistan to “work together” amid an “impending global catastrophe” over climate change.
The duke and duchess also met schoolchildren and had lunch with Pakistan’s prime minister and former cricket star Imran Khan, as part of their tour of the country.
The five-day trip was organised at the request of the Foreign and Commonwealth Office.