People wait in line to enter the 5th Circuit Court of Appeals to sit in overflow rooms to hear arguments in New Orleans, Tuesday, July 9, 2019. The appeals court will hear arguments today on whether Congress effectively invalidated former President Barack Obama's entire signature health care law when it zeroed out the tax imposed on those who chose not to buy insurance. A Texas judge in December ruled it was invalid, setting off an appeal by states who support the law.  (AP Photo/Gerald Herbert)
Gerald Herbert/AP
People wait in line to enter the 5th Circuit Court of Appeals to sit in overflow rooms to hear arguments in New Orleans, Tuesday, July 9, 2019. The appeals court will hear arguments today on whether Congress effectively invalidated former President Barack Obama's entire signature health care law when it zeroed out the tax imposed on those who chose not to buy insurance. A Texas judge in December ruled it was invalid, setting off an appeal by states who support the law. (AP Photo/Gerald Herbert)
Now playing
01:12
Lawyers respond to Obamacare hearing
ST. PAUL, MN - NOVEMBER 6:  Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before.  (Photo by Mark Erickson/Getty Images)
Mark Erickson/Getty Images
ST. PAUL, MN - NOVEMBER 6: Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before. (Photo by Mark Erickson/Getty Images)
Now playing
03:00
Walter Mondale dies at 93
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
Now playing
01:25
Bush calls on Congress to tone down 'harsh rhetoric' on immigration
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC.  Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Tasos Katopodis/Getty Images
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC. Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Now playing
03:18
Berman on Cruz's latest tweet: 'The pot calling the kettle violent'
Now playing
01:57
Chuck Hagel criticizes Trump's statement on Afghanistan
gun laws shootings Comer pamela brown nr vpx _00015627.png
CNN
gun laws shootings Comer pamela brown nr vpx _00015627.png
Now playing
02:23
'I can't answer that': Kentucky lawmaker responds to CNN on gun policy
Now playing
02:39
National security adviser: Russia will face consequences if Navalny dies in prison
Rep. Marjorie Taylor Greene (R-GA) speaks during a press conference outside the U.S. Capitol on February 5, 2021 in Washington, DC. The House voted 230 to 199 on Friday evening to remove Rep. Marjorie Taylor Greene (R-GA) from committee assignments over her remarks about QAnon and other conspiracy theories.
Drew Angerer/Getty Images
Rep. Marjorie Taylor Greene (R-GA) speaks during a press conference outside the U.S. Capitol on February 5, 2021 in Washington, DC. The House voted 230 to 199 on Friday evening to remove Rep. Marjorie Taylor Greene (R-GA) from committee assignments over her remarks about QAnon and other conspiracy theories.
Now playing
03:20
Marjorie Taylor Greene lashes out at media after backlash over controversial caucus
AP
Now playing
03:16
Maxine Waters: Jim Jordan is a bully and I shut him down
US Representative Marjorie Taylor Greene, Republican of Georgia, leaves her office on Capitol Hill on February 4, 2021 in Washington, DC.
NICHOLAS KAMM/AFP/Getty Images
US Representative Marjorie Taylor Greene, Republican of Georgia, leaves her office on Capitol Hill on February 4, 2021 in Washington, DC.
Now playing
03:51
Marjorie Taylor Greene launching 'America First' caucus
US President Joe Biden delivers remarks on Russia at the White House in Washington, DC on April 15, 2021. - The United States announced sanctions and the expulsion of 10 Russian diplomats Thursday in retaliation for what Washington says is the Kremlin's US election interference, a massive cyberattack and other hostile activity.
JIM WATSON/AFP/Getty Images
US President Joe Biden delivers remarks on Russia at the White House in Washington, DC on April 15, 2021. - The United States announced sanctions and the expulsion of 10 Russian diplomats Thursday in retaliation for what Washington says is the Kremlin's US election interference, a massive cyberattack and other hostile activity.
Now playing
02:22
White House backtracks on refugees decision after criticism
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Andrew Harnik/Pool/Getty Images
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Now playing
02:44
'National embarrassment': Biden reacts to mass shootings
MOSCOW, RUSSIA - APRIL 15:  Russian President Vladimir Putin (L) talks to talks to Foreign Minister Sergey Lavrov during a meeting with Uzbekistan President Islam Karimov in the Kremlin on April 15, 2013 in in Moscow, Russia. Karimov is on a state visit to Russia. (Photo by Sasha Mordovets/Getty Images)
Sasha Mordovets/Getty Images
MOSCOW, RUSSIA - APRIL 15: Russian President Vladimir Putin (L) talks to talks to Foreign Minister Sergey Lavrov during a meeting with Uzbekistan President Islam Karimov in the Kremlin on April 15, 2013 in in Moscow, Russia. Karimov is on a state visit to Russia. (Photo by Sasha Mordovets/Getty Images)
Now playing
02:07
Russia to expel 10 US diplomats in 'tit-for-tat response' to Biden sanctions
Now playing
03:10
Avlon: Here's what we know 100 days since the Capitol riot
A Russian flag flies next to the US embassy building in Moscow on October 22, 2018. - US national security advisor John Bolton is in Moscow holding meetings with senior Russian officials following Washington's weekend announcement of withdrawal from the Cold War-era Intermediate-Range Nuclear Forces Treaty, known as the INF. (Photo by Mladen ANTONOV / AFP)        (Photo credit should read MLADEN ANTONOV/AFP via Getty Images)
Mladen Antonov/AFP/Getty Images
A Russian flag flies next to the US embassy building in Moscow on October 22, 2018. - US national security advisor John Bolton is in Moscow holding meetings with senior Russian officials following Washington's weekend announcement of withdrawal from the Cold War-era Intermediate-Range Nuclear Forces Treaty, known as the INF. (Photo by Mladen ANTONOV / AFP) (Photo credit should read MLADEN ANTONOV/AFP via Getty Images)
Now playing
02:17
Political scientist: US-Russia relations are in the toilet
WASHINGTON, DC - JUNE 13: Rep. Michelle Lujan Grisham (D-NM) speaks during a news conference on immigration to condemn the Trump Administration's "zero tolerance" immigration policy, outside the US Capitol on June 13, 2018 in Washington, DC. (Photo by Toya Sarno Jordan/Getty Images)
Toya Sarno Jordan/Getty Images
WASHINGTON, DC - JUNE 13: Rep. Michelle Lujan Grisham (D-NM) speaks during a news conference on immigration to condemn the Trump Administration's "zero tolerance" immigration policy, outside the US Capitol on June 13, 2018 in Washington, DC. (Photo by Toya Sarno Jordan/Getty Images)
Now playing
02:39
Governor settles with former campaign staffer who accused her of sexual mistreatment
(CNN) —  

President Donald Trump has reason to hope his luck is changing after a long legal losing streak.

Trump got to celebrate a big win Wednesday in an emoluments clause case relating to his Washington hotel. And there are signs that a case in Louisiana could cause yet another near death experience for Obamacare, his predecessor’s top domestic achievement.

The courtroom action this week represents a potential reversal of fortune for Trump following a long list of defeats the President has tasted on cases from immigration to the 2020 census to his efforts to thwart Democratic oversight to his central campaign promise to build a border wall. For a man who bills himself as one of life’s ultimate winners, Trump’s legal losing record is a branding nightmare.

Yet the intimate relationship between this President and the courts actually goes beyond the win-loss calculation that normally powers Trump’s life. The judicial system serves multi-dimensional roles for Trump in his personal, business and Washington life.

While the law has often frustrated Trump’s political goals, he has still used it as a weapon to combat Democrats, as the glue in his conservative coalition and to postpone threatening political crises.

Often – as in the case of Trump’s national emergency declaration designed to fund his border wall or the census – it seems as if the long odds in court do not deter the President. The law gives Trump another venue for the endless fights that sustain his politics and his personality. Even if he loses he is showing his supporters he’s never giving up the battle.

Trump’s judicial appointments are likely to shape the character of American life for years after he’s left the White House. And it’s still possible court rulings could pose an existential threat to his personal and business legacy given the flurry of cases currently open in New York.

A rare win

As is often the case, Trump’s wins in the courts have been outnumbered by his losses this week.

On Tuesday, an appeals court ruled that the President violated the First Amendment by blocking Twitter users.

The administration has just tumbled to defeat before different judges – including in the Supreme Court – on its attempts to place a citizenship question on the 2020 census.

Two significant court rulings in May upheld Congress in its battle to subvert Trump’s war on oversight over Democratic lawmakers’ efforts subpoena his financial records.

Trump has also tasted defeat in huge cases on immigration – slowing or thwarting his efforts to build his border wall, and right at the start of his term on his original travel ban. The Supreme Court has since allowed parts of a rewritten plan to stand.

Research by the Center for Policy Integrity at the University of New York School of Law showed that the administration had won only three of 42 deregulatory cases, a paltry success rate of only 7%.

Yet Trump’s relationship with the courts is actually far more complicated than the win-loss ratio with which he judges his own success and that of everyone around him.

In decades as a businessman Trump was the initiator and the target of thousands of lawsuits. He used the courts to try to extricate himself from dicey situations, as a weapon in negotiations and to test the legal limits of business practice.

He used lawsuits to save face, to offer a new venue to prolong a fight, to put off a reckoning or agreed out-of-court settlements to limit the costs of personal and business liabilities.

Legal power plays

As President, Trump has also used courts to fulfill wider goals than simply winning and losing cases, especially since he’s struggled to get many major bills through Congress – apart from a big tax reform program.

With bold assertions of executive power, Trump has made the courts a constant presence in his presidency.

When he’s won, he’s trumpeted it. When – more often – he loses, the judgments become exhibits in his foundational political case that an elite establishment is out to get him and that he’s being treated unfairly.

“So now the Obama appointed judge on the Census case (Are you a Citizen of the United States?) won’t let the Justice Department use the lawyers that it wants to use. Could this be a first?” Trump tweeted after a reverse in the census case on Tuesday.

His frequent complaints about “Obama judges” reveal his view that the courts are simply an extension of the political game and earned him a rebuke from Chief Justice John Roberts.

Administrations often try to achieve through the courts what they cannot legislatively – and the Trump team along with allied GOP states has been especially enthusiastic in this regard.

Just this week, in a hearing in New Orleans, two Republican-appointed appellate judges appeared to suggest in oral arguments that a fresh challenge to Obamacare could succeed.

The case also reflects the manner in which, in an era of congressional stasis and polarization, courts are being called upon to do the job lawmakers might once have done.

Judge Kurt Engelhardt questioned why, after a US district judge declared the whole ACA unconstitutional, Congress did not pass a law clarifying what provisions should stay on the books.

“Why does Congress want the … judiciary to become the taxidermist for every legislative big-game accomplishment that Congress achieves?” Engelhardt asked.

The administration’s legal gambits have often reflected the chaos and politicized arguments that rock the administration every day and have sometimes hampered its own chances of success.

Last week, for instance, a Justice Department lawyer admitted he had no idea what was in Trump’s mind when he suddenly reversed course on the census case on Twitter.

Personal litigation

01:51 - Source: CNN
Justice Department changes step following Trump's tweet

Sometimes, Trump has turned to personal litigation to try to frustrate his political enemies.

In March, Trump personally sued his own accounting firm and the chairman of the House Oversight Committee to try to stop the handover of his financial records.

The President has sometimes been the target of litigation as well: Democrats are increasingly turning to the courts to enforce subpoenas.

A huge test of presidential authority is looming over Trump’s sweeping claims of executive privilege that may eventually work their way up to the highest courts.

The cases could eventually lead to profound rulings about the scope of presidential power that could resonate for decades to come. And if Trump were to refuse to hand over documents or tax returns ordered by the courts, he could turn overused predictions of a looming constitutional crisis into reality.

Treasury Secretary Steven Mnuchin’s refusal to hand over Trump’s tax returns to a House committee under a provision of the tax code is likely to spark a long and costly court fight.

That’s an example of where legal action suits Trump just fine.

In such cases there’s a good chance he will fail on the merits – but the law’s slow march means that he’s at least putting off a threatening political situation for another day – possibly even beyond the 2020 election.

Each new challenge becomes a new example of the “presidential harassment” – the term Trump and his allies use to stoke a sense of victimhood around his administration and to solidify his support with his all-important political base.

While the President may feel that he has a good chance of evading the worst possible outcome of Robert Mueller’s special counsel probe – he may not be out of the legal mire yet.

Trump is facing multiple civil and criminal investigations of his business, financial affairs, personal conduct, his foundation and inaugural committee.

A lasting legal legacy

01:29 - Source: CNN
Supreme Court to decide future of DACA

The political synergy between Trump and the courts has an even deeper connection to his presidency than cases in which he is embroiled.

The President’s decision to publicize a list of potential Supreme Court justices vetted by the Federalist Society was in retrospect one of the smartest moves of his 2016 campaign, embedding evangelical and judicial conservatives into his support base despite doubts about his character and ideology.

Trump has delivered on his vows to build a conservative majority on the Supreme Court with the seating of Justices Neil Gorsuch and Brett Kavanaugh. The court’s new ideological balance means that rulings favorable to Trump’s leanings on everything from deregulation to abortion could be handed down for years to come.

And the President’s alliance with Senate Republican Majority leader Mitch McConnell has been confirming conservative judges to lower courts at an impressive clip.

According to the Heritage Foundation’s Judicial Appointments Tracker, Trump has installed 127 federal judges – more than President Barack Obama’s figure of 89 at the equivalent point in his presidency.

There is no guarantee that such judges will necessarily share Trump’s challenging and unique interpretations on the limits of presidential power.

But some of them could provide a more ideologically friendly judiciary for Trump’s policy efforts if he wins a second term and could help break his losing streak.

And the Trump class of judges at all levels of the federal bench is likely to frustrate a future Democratic president.

CNN’s Dan Berman contributed to this report.