If one is arrested, the police have done so based on probable cause that the has committed a criminal offense. However, the police do not file the charges. They simply provide reports and evidence to the prosecuting attorney, who then decides whether or not charges should be filed, and if so, what charges.
Next, the prosecuting attorney files the document with the court, which alleges the charges against you.
At the arraignment, one is formally advised of the charges and their constitutional rights. Bail is often set during the arraignment. Bail is used by the court almost like an insurance policy that you will appear on future court dates. The amount of bail is determined by the judge. The judge uses two factors in deciding bail: the risk of flight and whether one poses a danger to the community. In some cases no bail is allowed.
Next, is a preliminary hearing if it is a felony offense to review probable cause. This is necessary for the judge to determine whether there is sufficient evidence to support the charges against you. Once a judge determines that there is probable cause, she/he sends the case to the Superior Court for trial. During the preliminary hearing, the district attorney or the judge can add additional charges and/or readjust the bail.
If the judge has determined that there is probable cause to support the charges, the prosecutor will file a charging document called an Information in the Superior Court. This alleges the charges which one will face at trial.