Initially, the UK government rejected the government of Pakistan's requests to deport Nawaz Sharif because he was in the country legally under British law. Up until August 2021, the UK government position remained that as no formal extradition request had been filed by the government of Pakistan, the UK government was bound by these laws, and there was no justification for cancelling Sharif's visa - despite the ongoing criminal case against him in Pakistan.
This was most recently set out in a letter sent to a constituent of then-PM Boris Johnson by the Foreign, Commonwealth and Development Office in December 2020, and subsequently published by the Daily Pakistan:
We are aware that Mr Sharif is in the UK. UK law sets out clearly and
publicly what the government can and cannot do on immigration matters.
We act strictly in accordance with the rules in all cases.
Mr Sharif's status under Pakistani law is a matter for the Pakistan
government and legal system. As such, the non-bailable arrest warrants
which have been served by the Pakistan High Commission in London, have
no legal bearing on his current status in the UK. UK police cannot
arrest someone in the UK on the basis of non-UK court orders.
As your email noted, Pakistan and Britain do not have an extradition
treaty. However, extraditions are still possible and have taken place.
If any extradition request were to be submitted through the proper
channels, it would be considered in line with UK law.
Despite Pakistan and Britain not having an extradition treaty, the government of Pakistan could have made a formal extradition request directly to the Home Secretary, who could then have made a decision to extradite Sharif based on Section 194 of the Extradition Act 2003. As far as I'm aware, the Pakistani government has not yet explained why no such request has been made.
While in the UK, Sharif continued to apply for his visa to be extended - seemingly on medical grounds, and up until August 2021, these continued to be granted. However, his most recent request for an extension on medical grounds was refused. A leading UK immigration lawyer suggested that the Home Office was no longer willing to accept Sharif's argument on these grounds:
If the previous visit visa extensions were on the basis of medical grounds (which seems to be the case here) then typically you can keep extending for a total of 18 months. In this particular case it would appear that the Home Office were no longer willing to keep extending on that basis.
If the latest application for an extension has been refused with a full right to appeal the entire appeal process can potentially take anything between 9 months to over 20 months to be decided by the Immigration tribunal in the UK. This period does not even take into account any potential subsequent judicial review once all appeal rights have been exhausted.
Sharif has filed such an appeal, and it will be decided initially by a First-tier Immigration and Asylum Tribunal. If Sharif is unsuccessful, he may be allowed to appeal to the Upper Immigration and Asylum Tribunal. If he is unsatisfied with the decision reached by the tribunals, he can request a judicial review in the Court of Appeal and then potentially appeal again to the Supreme Court. This legal process is likely to take quite some time, and until a final decision is reached, Sharif may continue to reside in the UK legally. If all his appeals run out, and he doesn't attempt to claim asylum or similar, then he will be deported to Pakistan.