Not every case that ever existed has gone to trial. Some cases get dismissed, others will settle. Then there are summary judgments, which are able to get cases thrown out the night before the trail. In order to have a summary judgment take place, one or both of the disputing parties will have to file a motion for a summary judgment.
If the existing evidence shows without question that one party is in favor to judgment, it will be entered summarily in favor of that party. The only way around this is if the opposing party can show that a factual dispute, which requires a trial, still exists. Most courts give the benefit of the doubt as to whether or not a material issue of facts exists with the non-moving party. In a close case, the person moving for summary judgment will usually lose on their motion.
Summary Judgments are essentially a short cut way of eliminating cases where no real factual arguments exist. In these cases, all that is left is application of the law. This mechanism is most commonly useful with commercial cases. Cases involving contract disputes, defaults on loans, etc. are easily handled with a summary judgment. If it can be applied, it is a great way to avoid a large trial with extra costs and fees from both the courts and lawyers.
Summary judgments are not an appropriate mechanism in all cases however. If there is significant financial dispute the case will have to go to trial and be heard by a judge and jury.
Once the motion for summary judgment is granted, the judgment on the issue or case is deemed to be a final judgment. After that point, a party may seek an appeal if they feel necessary. The appeal can reverse the grant of summary judgment and reinstate the claim in the lower courts. However, this is rarely done and most summary judgments are upheld on appeal.