This baseball statistic measures runs that are deemed to be the result solely of the offensive team's batting and not the actions of a fielder committing an error or the catcher being charged with a passed ball. In the event of an error or passed ball, the official scorer must "reconstruct" the inning's scoring as though the defensive miscue had not occurred. Following this "reconstruction", only runs that would have been scored without the defensive error are considered earned runs (ERs). All others are considered unearned runs.
Computing ERs can prove quite difficult for the scoring novice. There are two steadfast rules that always hold true: 1) a runner who reaches base on a defensive error can never score an earned run, and 2) any runs scored after there should have been three outs are considered unearned runs and are never considered ERs. Beyond that, it can get tricky. Here is a classic example used to illustrate what constitutes an ER:
THE INNING: Batter A singles. While batter B is at bat, A advances to second on a passed ball. Batter B then hits a home run. Batter C reaches second base on a two-base error. Batter D singles C home. Batter E grounds out, with D advancing to second. Batter F doubles D home. Batter G grounds out, with F advancing to third. Batter H singles home F. Batter I strikes out to end the inning. Five runs scored.
THE RECONSTRUCTION: A singles. B hits a homerun, scoring A. Batter C is out. Batter D singles, advances to second on E's groundout, and scores on F's double. G grounds out to end the inning. Three runs scored.
Because A, B and D all score in the reconstructed inning, their runs are considered to be earned. C and F do not score in the reconstructed inning, so their runs are considered to be unearned.
In this scenario, while five runs are scored, only three are considered ERs.