In the 1967 United States Supreme Court case United States v. Wade, 388 U.S. 218, Justice White defined the role of the prosecutor:
Law enforcement officers have the obligation to convict the guilty and to make sure they do not convict the innocent. They must be dedicated to making the criminal trials a procedure for the ascertainment of the true facts surrounding the commission of the crime. To this extent, our so-called adversary system is not adversary at all; nor should it be. The State has the obligation to present the evidence.
With those few sentences, Justice White nailed it. As a law enforcement officer, prosecutors are working to convict the guilty and to ensure that the innocent are set free. Prosecutors work to ensure justice for society as a whole.
To that end, prosecutors review cases referred to them by the police, they conduct their own investigations looking for potential crimes, they represent the government (they call it "the People") in arraignments, preliminary hearings, trials, grand jury hearings, and other court appearances, and several other smaller day-to-day tasks.
When the prosecutor gets a case file from the police, the prosecutor must review the file to ensure that there is enough evidence to believe the suspect committed the crimes alleged and to ensure that the police did not violate any laws in obtaining that evidence. The prosecutor will either find that all is in order or it is not.
If there is a problem with the evidence, the prosecutor can send the case back to the police for further evidence gathering. The prosecutor may send a case back because the evidence was gathered illegally and the prosecutor wants the police to try to get evidence legally or it could be sent back simply because there was not enough evidence. Either way, once the police conduct their further investigation, they will return it to the DA for further review.
If, on the other hand, the prosecutor is satisfied that the evidence is sound and that the suspect committed the crime, the prosecutor has a few options. If the case is a misdemeanor, the prosecutor will file a complaint with the court and the defendant will have to be arraigned on the complaint. If the charges are felonies, the DA can either send the case to the grand jury for an indictment or the prosecutor can file a complaint in court just as with a misdemeanor.