Thank you for the explanation. I do have one question though.
How does that square with the DA having to decide to try the case again if it is thrown out on appeal the first time?
It depends on why the case was thrown out on appeal the first time. For example, if the conviction were overturned on appeal because the evidence was insufficient to support a conviction - i.e., that no rational factfinder could have found guilt beyond a reasonable doubt based on the evidence presented, then the proceeding has completed and Jeopardy would prevent a second trial. On the other hand, if the conviction was overturned because of some procedural defect in the first trial - a defective indictment, for example, or too much pretrial delay - then the first proceedings have not concluded - because there has been no finding of factual innocence based on the facts - and the accused can be retried. Where a mistrial is declared by the trial judge, Double Jeopardy will prevent retrial only where the prosecution has acted in bad faith - good luck finding a judge who can see any sort of prosecutorial misconduct, even of the most egregious sort - and any other mistrial declared at the defendant's request will not prevent retrial.
In short, the Supreme Court has almost completely read the Double Jeopardy clause out of the Constitution. The only area where it currently provides any real protection is if the accused was acquitted by a jury on a full presentation of all the evidence. Unfortunately, I find that to be a distinction without a difference, and therefore that the Double Jeopardy clause of the Constitution means very little at all today.
Of course, even if there was a full and fair acquittal by a jury based on all of the evidence available to be presented in a federal court, or vice versa, in a state court, that does not prevent the acquitted accused from being prosecuted a second time on exactly the same set of facts for a crime that has the same elements, because of the dual sovereignty issue.
In other words, as a practical matter the Double Jeopardy clause of the Constitution doesn't amount to a hill of beans and the only real bar to retrial is the prosecutor's discretionary decision that it isn't worth the time and effort to retry the defendant - unless, of course, the prosecutor bears personal animus toward the accused and is determined to destroy the accused's life by any means necessary. That, of course, is precisely what the Double Jeopardy clause was supposed to prevent, and is what it no longer prevents.