No matter what your politics, sooner or later someone you don't agree with will be in charge at the national level.
There are also cases where states take on cases that the national government never pursues in the first case. IIRC, states pursued the tobacco companies when the national government would not (Democrat or Republican).
Of course, it happens in federal courts, so you also need separate and independent branches at the national level. But states that can act independently are important as well.
I think you misunderstand.
Courts in Europe are often older than the countries. Indeed, many "countries" of Europe have governments that only existed since the 1920s, or 1940s (depending on which World War wrecked the old system). Nonetheless, court rulings persisted through that period. So there's a string of independence here that's hard to replicate.
Furthermore, prosecutors are part of the court system over there (not part of the executable branch like here in the USA). IIRC: most European countries are Inquisitorial, rather than Adversarial (like USA).
Finally, because European systems have no "two party system", the "rulers" are rarely one party. Its often a coalition of two different parties, maybe even three parties.
----------
The USA's adversarial style of prosecutor vs defendant is extremely unique. Both good and bad. One of the bads is that prosecutors will give up on cases that mismatch with the politicians in charge.
But there's many mechanisms that would have prevented this situation from arising in France or Germany.