Such evidence doesn’t tell us what will happen in any individual country, but it is a better basis from which to reason than a counterfactual guess. The possibility of punishment and disgrace makes violating human rights more costly, and thus deters future leaders from doing so.

From the final Nuremberg trials in 1949 until the 1970s, there was virtually no chance that heads of state and government officials would be held accountable for human rights violations. But in the last two decades, the likelihood of punishment has increased, and newly installed officials may be more cautious before deciding to murder or torture their political opponents.

In addition, trials seem to project deterrence across borders. If a number of countries in a region pursue prosecutions, nearby countries also show a decrease in the level of repression, even if they have not held trials.

In Latin America, young military officers need only look to Argentina and Chile, where 81 and 66 individuals, respectively, have been convicted for crimes during previous dictatorships, to absorb the lesson that the possibility of punishment is much greater than it was in the past. This may help explain why military coups are now so rare in the region.

Likewise, the sight of Mr. Mubarak in a cage in a Cairo courtroom could deter government officials elsewhere in the region who are considering repressive measures against their populations. This may not help much with Mr. Bashir or President Bashar al-Assad of Syria, who are already deeply complicit in violent repression, and are unlikely to be deterred. But the history of dictators shows that some leaders cling to power at any cost, so it is hard to argue that the threat of prosecution is uniquely responsible for their continuing iron grip.

This does not mean that all governments must immediately and simultaneously begin far-reaching prosecutions. The desire for justice is persistent, and if political conditions for prosecutions are not ripe immediately after a democratic transition, such prosecutions can be held later.

Cambodia issued its first war-crimes conviction last year, over 30 years after the horrors of the killing fields. And domestic courts in Uruguay took 20 years to sentence the former authoritarian leader Juan María Bordaberry for human rights violations. Mr. Bordaberry died this summer in his home, where he was serving a 30-year sentence for ordering the murder of political opponents.

It has never been easy for any country to confront its past. Almost all leaders, when faced with calls for accountability, have wanted to turn the page and look toward the future. But demands for justice are robust, and countries that have held former leaders accountable have in most cases come away stronger.