“You have the right to have a secretary of defense whose views are better aligned with yours,” Gen. James Mattis wrote Thursday in his resignation letter to President Donald Trump. Mattis’ words — and the abruptness of his resignation — capped a series of reported disagreements with the president over the nation’s approach to foreign policy and national security.

Mattis, who has decades of experience in the military, had been viewed by lawmakers and policy experts as a stabilizing factor amid the president’s sharp-elbowed policy shifts. Mattis’ letter didn’t go unnoticed by Republican or Democratic lawmakers, who quickly aired concerns about his coming exit.

Trump thanked Mattis for his service on Twitter, writing that “tremendous progress” was made during his tenure. Mattis is expected to leave in February.

Here’s why Mattis’ resignation has worried lawmakers and what it means for U.S. foreign policy going forward.

What does Trump’s Cabinet look like without Mattis?

Reacting to the news, lawmakers appeared concerned about what would happen to the Cabinet without Mattis, who advised a president who didn’t have prior foreign policy or military experience.

Senate Majority Leader Mitch McConnell said he was “distressed” over Mattis’ resignation, adding that the U.S. must maintain a “clear-eyed understanding” that Russia ought to be recognized as one of the country’s foes, a point that Mattis made in his letter.

Republican Sen. Marco Rubio of Florida said Mattis leaving meant the country was headed toward a “series of grave policy errors.” Rubio told PBS NewsHour’s Judy Woodruff that Mattis’ message left him “deeply concerned that we’re about to undertake a series of foreign policy decisions that are going to undermine our security, that are going to undermine our alliances and are going to embolden our adversaries.”

House Minority Leader Nancy Pelosi said she was “shaken” by the news, adding that many lawmakers on Capitol Hill saw Mattis as a “voice of stability” within the Cabinet.

In his letter, Mattis stressed the U.S.’s commitment to allies — and the alliances’ ability to fend off global foes.

READ: Read James Mattis’ full resignation letter

“We must do everything we can to advance an international order that is most conducive to our security, prosperity and values and we are strengthened in this effort by solidarity of our alliances,” Mattis wrote.

Mattis was trying to stress that “the U.S. is great in many ways because we have such good allies — and antagonizing our allies is not something we can continue to do and expect to remain a superpower,” Former CIA officer John Sipher told the PBS NewsHour.

Sipher added: “The new secretary of defense is going to have huge problems with the president, even if he gets someone who is ideologically aligned with him because he makes impulsive decisions and doesn’t understand the ramifications.”

How do U.S. allies feel about Mattis’ resignation?

Andrew Weiss of the Carnegie Endowment for International Peace said much of the Pentagon’s identity is linked to the global alliance system.

The U.S. built partnerships over decades because it recognized that it couldn’t fulfill its foreign policy goals on its own, Weiss added. Mattis’ leadership helped to continue and strengthen those alliances.

Regarding Russia, Weiss noted how former President Barack Obama and his administration pushed for the need of a unified front between the U.S. and its European allies, with all the countries moving in lock step to oppose Russian aggression.

But the Trump administration instead “focused on how do we punish Russia and hit them on the nose,” Weiss said. “They didn’t invest very much in the allied unity” aspect of Russia policy.

The unpredictability inherent in Trump and his administration has prompted other allied countries to make “plans to hedge against the likelihood of a less reliable and predictable role for the U.S,” Weiss added.

Mattis provided a sense of continuity to nations in the NATO partnership, Weiss said, and whoever fills his role next may not be as invested in U.S. alliances and how they counter other powers like Russia and China.

European nations don’t have a lot of good options to manage security without the United States, Weiss said. “But they’re all starting to ask themselves, ‘what if the U.S. security commitment is not ironclad?’”

However, Trump may ultimately impede himself from reshaping the U.S. position in the world, Weiss said. “Trump’s notorious lack of discipline means he hasn’t been able to do as much damage to our alliances because he can’t follow through on his grandiose rhetoric.”

Could Mattis’ resignation be “welcome news” to North Korea?

Trump has long established his preference to pull troops out of Afghanistan. This week, there were initial reports of the Pentagon drafting plans to remove thousands of U.S. troops from the country, another apparent point of contention between Mattis and the president.

Experts said they now wonder if Trump is prepared to pull troops out of other countries, such as South Korea.

Back in May, The New York Times reported that Trump was determined to pull U.S. troops out of the Korean Peninsula, citing frustrations over the U.S. not being properly compensated for maintaining troops there and South Korea’s inability to quell North Korea as a nuclear threat.

Doing so would be “welcome news” to North Korea leader Kim Jong Un, said Sung-Yoon Lee, professor of international politics at Tufts University’s Fletcher School of Law and Diplomacy.

Trump has used the troops as a “bargaining chip,” he said, to get allies in the region to pay more for the cost of stationing troops there. Trump has insisted that South Korea pay twice what is spends now, Lee said.

South Korea pays almost 50 percent for the stationed troops, totaling almost $1 billion a year.

“To President Trump, that comes across as cheap,” Lee said.

The denuclearization talks with North Korea have stalled this year, but if Trump pulls troops out of the region it would put pressure on South Korea, Lee said.

“For someone like Mattis who knows a lot more than Trump on these issues, it would have come as playing with fire,” Lee said.

However, Joseph DeTrani, a former special envoy for negotiations with North Korea, said he couldn’t imagine any secretary of defense enabling the president to walk away from the United States’ allies abroad, including South Korea. “It’s who we’ve been since the Second World War.”

“This is not the time to be retrenching,” he said, adding that doing so would send the message to our allies that “we’re fickle.”