Charges can be discontinued in the District and Supreme Court by the Director of Public Prosecutions.
In the Magistrates Court, charges can be discontinued by the police or dismissed. The former means that the police can recharge you with the same offence; if no evidence is offered, and the charge dismissed, an acquittal is recorded and it is unlikely that the police can recharge you.
Discontinuing charges is not something that the prosecution do lightly at all. Good defence lawyers look at the evidence and look to see if a charge/s can be proved beyond a reasonable doubt. If not, they make submissions to the prosecution to discontinue the charge/s.
Prosecutors may sometimes decide to discontinue a matter after they review the evidence.
Other factors for discontinuing a matter may include the public interest, the victim does not want to continue, and the state of mind of the accused or victim.