Rather it only does it when someone makes the decision that to do so is convenient for maintaining the integrity of the Judicial system; thereby creating the facade that the entire thing isn't rife with capricious singularities like it actually is.
When laws are impossible to consistently enforce (as evidenced by prosecutorial discretion), or juries are not on board with seeing them enforced, it should be a much more blatant signal something is up or off than it is.
In fact, is there even a record of cases of "refused prosecutions"? If not, maybe there should be. Then there's be an objective metric to analyze to see if a law is being abused selectively.