It's not necessarily about corrupting the courts. It is about maintaining influence or outright control over police, prosecution, legislation or whatever body (very often a political body, as in The States) is responsible for investigating or prosecuting political offenses.
In failed rule of law states, it has often happened that former politicians were/are criminalized. This can make losing power, in practice, directly lead to losing life & freedom. This then becomes a mandate to maintain power by whatever means necessary.
It also opens the door to political purges of oponenets.
I'll take an example from the Middle East (my home). When Saddam lost power, he was hanged. Gadaffi was lynched. Mubarak was imprisoned, then released when his faction came back into power. This creative an imperative for Assad to maintain power in Syria. Losing power is a death warrant for him, and he is willing to kill even more brutally to preserve himself.
In Israel, Netanyahu is under criminal investigation. He has immunity from prosecution while in power, but not from investigation. This is very dangerous and many analysts (including US generals and spooks) are worried he will start a war in order to consolidate power. tricky stuff.
These are not rule of law states, and they do not have independant judiciaries. But the principle stand. This is why I found (for example) Trump's threats to Clinton so disturbing. If he had followed up, the entire american system would be in danger.
Realistically, the process in place is there for a reason. Small crimes (eg Clinton's emails or Trump's contact with Russia, if it doesn't turn out to be worse than reported thus far) are swept under a rug. Large crimes (Clinton's BJ?) should be investigated through some non-criminal (courts are OK, the US system is suboptimal here) system where life and freedom are not at stake, just power.
Courts cannot be subsidiaries of executive-legislative power (even in the states where it is explicitely forbidden executive & legislative are not really seperate) but the opposite also cannot be.
It is ugly the way it is. We should be doing better. But, there really are fundamental issues here with the stability of democracies at stake.