On an issue of pure law, an appellate court decides if the trial judge got it right or wrong from scratch, and if there is a case that is a better match than the one that the judge used that leads to a different outcome in the case, then an appellate court is likely to find that the trial court's ruling is a reversible error.
On an issue of mixed fact and law, or on a legal issue where a judge has more discretion in how the law is applied (like many evidentiary issues), a judge is given more deference, and the judge will generally only be reversed if no reasonable judge could have applied the correct law to the facts viewed in the light in which the judge saw them, and then, only if an application of the correct law to the facts viewed in the light in which the judge saw them would have changed the outcome of the case. There are a couple of ways that this standard of review is described, one of which is called "abuse of discretion" review.