Prosecutions and corrupt legal practices were a long standing problem of the UK and history which the founders were aware of.
The pardon power most of all needs to exist to protect the president or governor from their own family from being targeted by the corrupt to seek revenge or coerce them. You must have seen many stories with plots along such lines.
Secondly, the public lacks a way to correct popularly wrongful convictions except by a single elected official (some judges are elected but they are supposed to ignore popular opinion.)
A corrupt president can be prosecuted after a future honorable SCOTUS overturns the corrupt invention of immunity. More importantly, the house and senate, like a board of directors, can fire the CEO/president politically without ANY need for the legal system; it's a political trial where ultimately the voters (shareholders) decide what is acceptable behavior.
This is a fundamentally flawed system where many others do better: A prime minister loses a confidence vote and elections are held AS NEEDED not on a mindless arbitrary time schedule! Furthermore, a total incompetent who causes a government shutdown is going to get the boot in any functional government.
So it's the ignorant American who is to blame for all of this; which BTW is a defining trait worldwide for Americans.