The governing authority in Canada is R. v. Power (1994), which cites Canadian, English and U.S. law.
The basic concern from the Court is that the decision whether to prosecute is a classic executive function, not a judicial one. The majority expressed concern that if the courts began to tell prosecutors which cases to prosecute, the courts would be intruding on the executive function. There would also be the concern that the courts would then be open to an allegation of partiality, citing Viscount Dilhorne in Director of Public Prosecutions v. Humphrys (H.L., 1976):
[QUOTE=Viscount Dilhorne]
A judge must keep out of the arena. He should not have or appear to have any responsibility for the institution of a prosecution. The functions of prosecutors and of judges must not be blurred. If a judge has power to decline to hear a case because he does not think it should be brought, then it soon may be thought that the cases he allows to proceed are cases brought with his consent or approval.
[/QUOTE]
(emphasis added by L’Heureux-Dubé of the SCC)
The SCC in Power recognised a residual discretion in the courts to stay charges for abuse of process:
[QUOTE=L’Heureux-Dubé J.]
I, therefore, conclude that, in criminal cases, courts have a residual discretion to remedy an abuse of the court’s process but only in the “clearest of cases”, which, in my view, amounts to conduct which shocks the conscience of the community and is so detrimental to the proper administration of justice that it warrants judicial intervention.
To conclude that the situation “is tainted to such a degree” and that it amounts to one of the “clearest of cases”, as the abuse of process has been characterized by the jurisprudence, requires overwhelming evidence that the proceedings under scrutiny are unfair to the point that they are contrary to the interest of justice. As will be developed in more detail further in these reasons, the Attorney General is a member of the executive and as such reflects, through his or her prosecutorial function, the interest of the community to see that justice is properly done. The Attorney General’s role in this regard is not only to protect the public, but also to honour and express the community’s sense of justice. Accordingly, courts should be careful before they attempt to “second‑guess” the prosecutor’s motives when he or she makes a decision. Where there is conspicuous evidence of improper motives or of bad faith or of an act so wrong that it violates the conscience of the community, such that it would genuinely be unfair and indecent to proceed, then, and only then, should courts intervene to prevent an abuse of process which could bring the administration of justice into disrepute. Cases of this nature will be extremely rare.
[/QUOTE]
(my underlining)
The key point here for the Court is that the decision to stay for abuse of process is not a prosecutorial function (i.e. not an intrusion on the executive power), but rather the courts protecting their own process and not allowing it to be abused (i.e. a judicial function). But it cannot be extended to a general power to review the exercise of prosecutorial discretion in every case.