The Official Scorer and Ground Rules
One person in the press box decides hits and errors, and each ballpark writes its own rules for its own walls.
What it actually is. The official scorer is not an umpire. He sits in the press box and makes the judgment calls that only affect statistics: hit or error, wild pitch or passed ball, which pitcher gets the win, whether a fielder's choice occurred. Ground rules are park specific rules covering the particular obstacles at that stadium, agreed before the game and explained to both managers.
What somebody who knows the game gets out of it. The scorer is the only place in professional sport where a single unelected person's opinion permanently changes a statistical record, and it matters more than it should because ERA depends on the earned run ruling and batting average depends on the hit or error ruling. Scoring is also home biased in measurable ways, which is one more reason the modern metrics that avoid scorer judgment, strikeouts, walks, exit velocity, are preferred for evaluation.
The numbers worth knowing. A scorer makes perhaps five to fifteen judgment calls a game. A ruling can be appealed to the league office and changed after the fact, which happens a handful of times a season.
What people get wrong about it. Ground rules are different in every park and they are why an identical batted ball is a double in one stadium and a live ball in another. The catwalks at Tropicana Field are the most famous example, but every park with an unusual wall, a camera well or an odd railing has its own list.
At Little League and travel ball. Youth fields have ground rules too and they are usually explained at the plate meeting before the game: overthrows into a dugout, balls under a fence, obstacles in play. A coach who does not attend the plate meeting is agreeing to rules he has not heard, and that is where most weekend disputes start.
Batter's Eye: look up anything in baseball