The average person's understanding (or lack thereof) of the American judicial system is pretty sparse. That is, until you become involved in it … which is a poor time to learn. The usual progression of events in criminal matters finds an investigator (read here peace officer) developing a case to the point they think they have sufficient evidence to get a Grand Jury to proceed further with the encouragement/ help of a prosecutor. That's not always the way it works.
A Grand Jury can indict whomever they want given sufficient cause but, as a practical matter, if they don't have the support of the prosecutor said case won't get prosecuted … that is, unless they choose to indict said prosecutor for not doing their job. The only bit of legislation that holds a D.A.'s feet to the fire here in Texas is found in the Government Code which directs a D.A. to address matters of monetary malfeasance on the part of public officials and that's about it. Beyond that, a D.A.'s powers of discretion concerning whom to prosecute or not prosecute are so broad as to make them practically autonomous. That said, they most often do rely on the veracity of their investigators as does the judge or any other magistrate that issues warrants or hands down sentences.
As it concerns warrants they are most often issued by a Grand Jury but that is not the only method by which they come to appear. Any person who provides sufficient evidence to a magistrate that a crime has been committed can instigate the issuance of a warrant. A warrant gets you in front of a petit jury, ideally of your peers, that will determine your guilt or innocence unless you work a deal with the prosecutor to avoid a jury trial.
It is the nature of our judicial system that it was born in the aftermath of a system (read here Star Chamber) that saw a limited number of folks whose loyalties and intent might best be called suspect handing down sentences in a manner that did not inspire confidence in the English Commonwealth. Hence the system that we now have that sees so many moving parts involved in an attempt to insure justice.
The good and the bad news is that any system of justice shy of The Judgment involves man at this point and any verdict will only be as good as the nature of those that participate in this endeavor along the way.