The U.S. Supreme Court. (Win McNamee/Getty Images)

Many who oppose President Trump’s agenda and approach to governing are hoping that U.S. courts will defend the nation’s core democratic values. They took heart last month, when the U.S. Court of Appeals for the 9th Circuit upheld a lower court’s ruling bloc­king Trump’s executive order restricting travel from seven majority-Muslim countries. ACLU Executive Director Anthony Romero declared that courts “are a bulwark in our democracy when President Trump enacts laws or executive orders that are unconstitutional and illegal.”

But courts’ powers rely on more than laws. Even if U.S. courts now serve as bulwarks of democracy, they are only as powerful as politicians and the public want them to be. A democracy can take down one wall as it builds another.

Let’s look at how courts’ ability to check the government can be eroded — and, conversely, how it can be shored up.

Here’s how to undermine courts’ ability to check power

There are three primary ways to reduce courts’ willingness to act as brakes on power.

The first is by removing judges who are out of step with the government. History is full of examples of political leaders who try to limit courts’ power by impeaching judicial opponents. Bolivia and Turkey have very recently seen their judiciary changed as presidents removed unfriendly judges. Turkey’s president, Recep Tayyip Erdogan, purged more than 200 judges last year after an attempted coup. The Bolivian Constitutional Court was stripped of a quorum in 2007, after repeated attacks from President Evo Morales and his allies in the legislature. By the end of the year, only one regular member of the court remained.

This is an unlikely path in the United States. Federal judges can be removed only through impeachment, which the Democrats in today’s Senate could stop.

The second option is by creating new positions or appointing ideological backers. There are 116 vacancies on the federal courts — about 14 percent of the entire federal judiciary. The most well-known vacancy is the one on the Supreme Court, which has remained unfilled for almost a year. The Democrats cannot block nominees to the lower courts using the filibuster, and they may soon be incapable of blocking a Supreme Court nominee. As a result, the ideological tone of the U.S. federal judiciary is likely to shift within several years.

In a third and more sinister way, the executive branch would refuse to implement court orders. The Department of Homeland Security released a statement on Jan. 29 committing itself to complying with the 9th Circuit orders — but the Guardian reported about instances in which those court orders were apparently being ignored.

What gives courts the power to stop the executive branch from taking unlawful actions?

Barry Weingast famously argued 20 years ago that leaders are held to limits on their authority only when they expect the public to defend democratic values. The threat of mass mobilization is what restrains the powerful.

This argument implies that, in the United States, a judge’s power comes from the public’s shared belief that political officials should comply with judicial decisions.

There are two essential and related ingredients.

The first is a citizenry that is engaged politically yet unified in its support of our fundamental political institutions and the rule of law.

While political engagement can highlight and heighten political differences, core institutional commitments are values that liberals and conservatives alike can share, and they are critical to the functioning of our liberal constitution. It is one thing to disagree about Trump’s executive order on immigration. It is quite another to disagree about whether it would be appropriate to ignore a judge who might find the order unconstitutional.

Limited government does not require policy consensus; it does require broad agreement about the basic legitimacy of the procedures used to review the powerful.

The second essential ingredient is accurate information about the behavior of public officials.

Effective courts require a free press that watches whether agencies implement the policies they are charged with carrying out. By reporting on government activity, the news media can reveal instances in which citizens may want to protest. By covering protests, they spread information about how citizens perceive government action. By reporting on the nuance and content of court orders, government reactions and protests, the press helps distinguish between two types of grievances — those deriving from policy disagreements and those deriving from disagreements over fundamental principles of limited government.

Making this work in practice is a vexing challenge in divided societies.

Recent polling suggests that Americans are roughly evenly split over whether the country’s judges can be trusted to make the best decisions for the country.

As has been widely discussed, the Trump administration has declared a “war” on the news media, openly saying that journalists are the enemy of the people. Trump has even referred to the media as “the opposition party.” One possible effect is that such a designation encourages doubt about whether objective facts exist and can be reported in an unbiased manner.

Of course, as has been widely discussed, the United States has been losing a shared narrative of facts for years, as different factions get their news from diverging and self-enclosed news ecosystems that amplify their own points of view and ignore others.

Nevertheless, attacks on the news media not only threaten the public’s ability to sensibly deliberate over policy options, they also threaten an essential component of courts’ democratic power: the public’s ability to monitor possible violations of rules of the regime.

In short, for courts to serve as meaningful checks on power, a nation must also have an engaged public that is informed by a professional and free news media reporting on the two ways in which courts can be rendered irrelevant.

Americans may differ greatly over particular policy choices, but if they want their government to be constrained, they must stand up for constitutional limits on each branch’s actions. The failure to do so risks a genuine constitutional crisis.

Tom S. Clark is Asa Griggs Candler Professor of Political Science at Emory University and author of “The Limits of Judicial Independence.”

Jeffrey K. Staton is associate professor of political science at Emory University and author of “Judicial Power and Strategic Communication in Mexico.”