When you have to go to court, the system is designed to protect you just as much as someone who is a victim of a crime. You deserve to have your innocence preserved until you're proven to be guilty. If the prosecution or authorities make a mistake, it could be enough to have your case dismissed.
Here's an interesting news story about a man who was arrested and charged for possessing ricin in Georgia. The man, a stated white supremacist, was facing federal charges for possessing the dangerous toxin but his case was dismissed on a technicality.
In the U.S. District Court judge's order, he explained that federal law changes between 2004 and 2005 left ricin off the list of illegal biological toxins that are better known as "select agents." As a result, the prosecution could not charge him for possessing ricin that year; it was legal on paper.
The judge admitted that the man could be charged for other federal law violations, but the specific charge the prosecution wanted to use would be unsuccessful. Prosecutors raised the concern that ricin was always intended to be on the toxin list and that letting the man go would be absurd. Fortunately for the man, the judge disagreed and held to the laws as they stood at that time.
As a result of the changes in federal law and the list of toxins that cannot be possessed by individuals, this man will be able to avoid a conviction. This is just one example of why having a strong defense team is necessary when you face federal charges.