Prosecutors are supposed decide whether to file charges by evaluating the evidence before them. (See How do prosecutors decide whether to file criminal charges?) But a decision to file charges may be influenced by factors beyond the specific facts of the incident described in the police report. Among the potential factors are the following.
Policies on certain crimes. Some prosecution offices adopt policies on certain types of crimes, often in response to community pressure, and these policies may dictate the prosecutor's approach to a case. For example, an office may decide that arrests for driving under the influence of drugs or alcohol will always be taken to trial and not "plea bargained" down to a lesser offense.
Political ambition. Political ambition may also influence prosecutors. Most prosecutors are elected officials, and many of them view their position as a stepping stone to higher office. Public opinion and important support groups often affect their decisions on charges. For example, a prosecutor may file charges on every shoplifting case, no matter how weak, to curry favor with local store owners who want to get the word out that shoplifters will be prosecuted.
What justice requires. Many decisions come down to the prosecutor's sense of what justice requires in the case at hand. Prosecutors are supposed to both enforce the law and "do justice." Doing justice means that a prosecutor occasionally decides not to prosecute a case (or files less severe charges) because the interests of justice require it, even if the facts of the case might support a conviction. For example, if an otherwise law-abiding person makes a one-time, foolish mistake, a prosecutor may decide that it would not serve any purpose to spend time and money prosecuting, especially when the chances that the person will re-offend are small.
Other factors can come into play when prosecutors make charging and settlement decisions. For example, see Do defendants get better plea deals in big cities?