Sure, it's a simple question, easily answered with some sort of smartish quip. However, a serious answer requires more complexity.
A prosecutor is a person in court who represents society's interest in the enforcement of societal norms as expressed via the statutes, common law, and constitutions. This is his primary duty, the one to which he, or more likely his boss, has been entrusted by the electorate.
In order to do this, he is given one tool: the request for imprisonment. There are multiple lesser tools which he has to offer: fines, rehab programs, probation, etc. However, each and every one of these tools works only with the threat of imprisonment behind it. It's not a particularly subtle or precise tool; as I've said here before, it's a hammer, not a scalpel.
This tool is used to accomplish one goal: strengthening societal norms. This is done in two ways. The most important, is providing an impetus and example which will keep those who are honest from choosing to violate basic social norms. This passive use is fairly basic: the knowledge of the existence of the criminal justice system and its punishments acts to keep people from doing things that society tells them they should not do.
Of course, there will always be a group of people who violate societal norms and who must be dealt with. The objective here is to prevent further violations. Depending on the the violation and violator, there are two basic ways to handle this (although an infinite variety within them). The first is the threat of imprisonment. This can take the form of various types of probation and treatment programs, all aimed at bringing the violator into alignment with society. It can also take the form of short term imprisonment, which is demonstrative to the offender both that society is serious about enforcing its basic norms and how disruptive and problematic a longer incarceration could be to the life of the offender and his family; hopefully, the combination will deter further violations. The second way to do this is long term incarceration. Once a person has demonstrated that he cannot, or will not, conform to basic societal norms removal from society as a protective measure becomes the only way to deal with the offender.
Overlaying all of this is the universal duty of prosecutors as "ministers of justice." Virginia Rule 3.8, Comment 01. This is more often referred to a command to "seek justice." Many read into this a directive toward distributive justice. However, an examination of the special rules applied to prosecutors reveal that this is actually a command to uphold procedural justice: "This responsibility carries with it specific obligations to see that the defendant is accorded procedural justice and that guilt is decided upon the basis of sufficient evidence." Id.
The prosecutor's duty toward procedural justice is rather easily defined: make sure the trial is fair. Most Bars have written some part of this into their ethics rules, requiring things such as Batson disclosures and not filing charges without probable cause. However, it's my opinion that the duty toward procedural justice goes a little further. At the very least, it obligates the prosecutor to do his best to mitigate other harmful factors which may come into play in a trial. As an example, if the defense attorney is being ineffective the prosecutor has some duty to act. This is not to say that if an experienced defense attorney or obstinate defendant chooses to undertake tactics the prosecutor believes will aid the prosecution he is obligated to take steps to counteract them. To the contrary, that's just part of the adversarial system. However, when a defense attorney is acting in a manner which indicates problems which are beyond tactics a prosecutor should take some ameliorative steps. You take the young defense attorney aside and give her some advice (and, to keep yourself honest, tell her to check what you've said with other defense attorneys). If someone has not filed a discovery request in a serious case, you call them (if for no other reason than to foreclose an ineffective counsel habeas).1 The circumstance in which a prosecutor might have to take steps to insure a fair trial or plea are pretty much an endless list (and not limited to just circumstances involving defense attorneys). None of this diminishes the prosecutor's duty toward society at large. In fact, by foreclosing ineffective assistance of counsel habeas claims, in serious cases it enhances the prosecution's effectiveness.
In the end, prosecution is an art, not a science. No two prosecutors are going to be exactly alike. No two offenses are going to be exactly alike. No two offenders are going to be exactly alike. The prosecutor is the guy trying to use his hammer to paint the world back into its proper order.
1 And, defense attorneys, if a prosecutor calls offering discovery the appropriate response isn't "I don't need to make a discovery motion. I've got everything in your file." You will look pretty bad when you stand up to object to the introduction of X because it wasn't disclosed pre-trial and the prosecutor can recite to the judge verbatim, from his notes of the conversation, what you said when he tried to prompt you to file a discovery motion.