If the parties to a civil dispute can't agree on how to settle the matter on their own, a trial may be held to decide whether the defendant failed to carry out a legal duty to the plaintiff. If the person is criminally accused and pleads "not guilty," a trial will be held to find out whether the accused person committed the crime charged.
If the parties choose to have a jury trial, determining the facts is the task of the petit ("small") jury. If they decide not to have a jury and leave the fact-finding task to the judge, the trial is called a bench trial. In either kind of trial, the judge decides what legal standards to apply. If there is a jury, the judge tells the jury what the law is.