The pardon power is old; it is one of the ancient prerogatives of the Crown, for example. The point made above about its politicisation in the US where the head of State and the head of government are the same is well taken, but its purpose elsewhere is still important.
In light of the observation above that separate heads of state only act on the advice of the executive, I would note that governments outside the US do not have a statutory use-by date of 8 years. Governments elsewhere can be re-elected after two terms, and so the political scandal (which doesn’t bother an end of term limit president) still bothers other governments.
One of the necessary features of any criminal justice system is finality - any system that just allows endless argument about convictions is merely a debating society. For that reason, the primary rule almost everywhere is that you get one go at defending yourself at a trial, and as a defendant you can’t in general hold back a good argument or piece of evidence on the prospect that if you lose, you’ll get another crack at it. Fresh evidence after a conviction is not an easy ground of appeal to succeed with, for good reasons.
A further consequence of the principle is that in most places you only get one go at an appeal (by that I mean one run through the appeal structure). In the US, the position is complicated by the Federal system, habeus corpus, and the taking of constitutional points at various stages, but generally the desirability of making all your arguments on appeal in one go is very compelling.
I cannot speak for the US, but elsewhere, the point is so strong that appellate courts often don’t have jurisdiction to hear a second appeal brought by a defendant.
So - what happens if compelling evidence of innocence emerges after the appeals have been exhausted? Enter the pardon.
In some places, the pardon application is made to the executive government which considers the point itself. In other places, the executive has statutory power if it wishes to send the matter back to the courts, thereby granting in essence a second appeal which would otherwise not be possible, but with the executive acting as a gatekeeper to stop the courts being choked with meritless try-ons.
In the end it is a useful process which balances the need for finality with the prospect that in rare cases the demands of individual justice will justify overriding the usual rules of The System.