During his first days in office, President Trump quickly delivered on his foremost campaign promise: to bring change to Washington. He dispensed a flurry of executive orders and memoranda on a wide range of issues, including repealing the Affordable Care Act, building a wall on the Mexican border, and withdrawing from the Trans-Pacific Partnership. For the national security community, however, the two most important directives were the immigration ban and the reorganization of the National Security Council — and both reveal a larger behind-the-scenes battle among the president’s most senior advisors.

It was hard to miss the symbolism surrounding the signing of the immigration ban. Trump issued it during his first visit to the Pentagon for the ceremonial swearing-in of Secretary of Defense James Mattis. It was held in the revered Hall of Heroes against a giant backdrop of a Medal of Honor — the nation’s highest military award. But, he unexpectedly used the well-publicized occasion to sign an order temporarily barring refugees and immigrants from seven Middle Eastern countries — including Iraq, whose troops are fighting alongside American forces. This placed Mattis in the uncomfortable position of appearing to support this ban — indeed, implying that the Defense Department wanted the ban as a means of protecting the nation — when, in fact, Mattis had explicitly opposed such a policy only six months earlier. Furthermore, Secretary of Homeland Security John Kelly, whose agency is responsible for enforcing all immigration laws and policies, reportedly had little input to the decision and learned of the announcement from a television report. Kelly and Mattis later pushed back against the White House for not consulting them before issuing an order that directly affected their agencies.

Both Mattis and Kelly are retired generals, of course. But so are Mike Flynn, the national security advisor, and Keith Kellogg, the executive secretary of the National Security Council. These two White House generals seemed to outflank the two cabinet generals on the sudden release of the immigration ban. And, they scored another apparent victory with the National Security Council reorganization, which included the unprecedented decision to elevate Kellogg and White House chief strategist Steve Bannon to permanent membership on the Principals Committee while removing both the chairman of the joint chiefs of staff and the director of national intelligence from regular attendance.

Despite early concerns that Trump would militarize foreign policy by filling senior administration positions with so many retired generals, the emerging reality is quite different. Instead, there seems to be a rising internal struggle for power between the two cabinet generals, Mattis and Kelly, and the two White House generals, Flynn and Kellogg. The four men share similar backgrounds. They all spent long careers in the nation’s ground forces, and all but Kellogg (who retired in 2003) served as senior leaders during the wars in Iraq and Afghanistan. But their mind-sets are anything but uniform. The cabinet generals and the White House generals have very different views of both the global threats to American security and what we should be doing about them.

Mattis and Kelly are highly respected former Marine four-star generals, and both retired with sterling reputations among their peers and subordinates alike. Both have remained publicly apolitical since then, and neither endorsed a candidate the 2016 presidential campaign. Both have tremendous experience in running large organizations, navigating the bureaucratic wickets of the White House and the interagency, and working with Congress. They know each other well, share the intensely tight culture of the Marine Corps, and like and respect one another immensely. Mattis, moreover, leads the same group of rising generals and mid-grade officers with whom he served in peace and war during his 42 years in uniform. He also has a very close relationship with Chairman of the Joint Chiefs of Staff Joseph Dunford, another Marine four-star general who served as Mattis’ chief of staff during the 2003 invasion of Iraq. In recent Congressional testimony, Mattis and Dunford presented similar assessments of the world. They both identified Russia as the greatest threat facing the nation, and both reinforced the value of American friends and allies around the globe. Indeed, Mattis’ first overseas trip was designed to reassure long-standing U.S. allies in Asia and reaffirm the importance of America’s international partners). Mattis, Kelly, and Dunford represent the traditionalist faction within the Trump foreign policy team.

Flynn and Kellogg sit just across the river from the Pentagon but might as well be from a different planet. These retired Army three-star generals were both heavily involved in the Trump campaign. Last year, Flynn became one of the most public, outspoken, and partisan Trump spokesmen — leading Politico to dub him “America’s angriest general.” His status as a recently retired general was showcased in every one of his campaign appearances, drawing on the immense respect and popularity of the U.S. military among voters. Flynn attacked Hillary Clinton during the campaign with exceptional vitriol — including chanting “lock her up” on stage at the Republican National Convention. Kellogg played a less visible but no less important role during the campaign, advising Trump on national security and later serving on Trump’s landing team for the Pentagon during the transition. But, what truly sets them apart from the cabinet generals is their world view. They lead the “religious warriors” faction inside the administration, which regards radical Islam as an existential threat to the United States that requires re-orienting U.S. defense priorities accordingly. Many of Flynn and Kellogg’s broader world views also differ sharply from those outlined by both Mattis and Dunford in their recent testimony. Both White House generals see Russia as a potential partner, seem amenable to Syria remaining ruled by Assad, are more hostile to the rise of China, and are prepared to escalate the growing confrontation with Iran.

On paper, it seems clear who should have the greater influence on a new president with virtually no foreign policy experience. They are seasoned, responsible players who have commanded at the highest levels in our recent wars and personally know the impact of sending Americans into harm’s way. Mattis and Kelly also have substantial experience navigating the Washington policy process and working effectively with other parts of the U.S. government. Both are balanced, non-partisan leaders willing to tell hard truths and confront falsehoods with facts, even when it may be highly unpopular. These are the pros. And, as retired four-stars, they still “outrank” the retired three-stars, a distinction that continues to matter — perhaps especially to Flynn.

But paper does not matter. What matters in any administration is who has the president’s ear. And the events of the last two weeks, especially the National Security Council reorganization, suggest that the White House generals have more influence with President Trump than the cabinet generals, at least for now. That may or may not continue, since it is still the early days of the new administration. We know that the president has listened to Mattis on other issues, especially on the use of torture. But campaign relationships and proximity to the Oval Office both make a difference, especially to a commander-in-chief who seems strikingly averse to important details of the policy-making process and deliberate decision-making. Even if Flynn is losing some of his influence (especially to Steve Bannon, the president’s chief strategist), both he and Kellogg will still have tremendous access to the president. They will have his ear daily and often multiple times a day. That gives them enormous personal, bureaucratic, and ideological advantages.

What does this mean for the two cabinet generals? Mattis and Kelly ultimately serve at the pleasure of the president. To be effective in their jobs and faithfully serve the nation, they must be comfortable supporting Trump’s policies in public after providing their candid inputs — aggressively, if need be — in private. But to maximize their influence, they will have to carefully choose their battles. There will be daily friction between their departments and the White House, but they should avoid intervening in those battles as much as possible, saving their personal capital for only the most important ones. They should avoid having their credibility and presence leveraged to support policies and decisions that conflict deeply with their principles and beliefs. And, they must also build broader relationships across the administration with like-minded leaders to increase the weight and authority of their views.

The poorly-staffed and hastily implemented immigration ban was an early loss for both of the cabinet generals. But it was not a battle that resulted in the loss of life or had existential consequences, and those are sure to come. When that day inevitably arrives, all four of these generals, along with the president’s other advisors, will need to come together and ensure that a still-inexperienced president gets to hear the widest range of voices and advice from his team. Perhaps better than anyone else close to this commander-in-chief, the generals know the consequences of getting those decisions wrong.

Lt. Gen. David W. Barno, USA (Ret.) is a Distinguished Practitioner in Residence, and Dr. Nora Bensahel is a Distinguished Scholar in Residence, at the School of International Service at American University. Both also serve as Nonresident Senior Fellows at the Atlantic Council. Their column appears in War on the Rocks every third Tuesday. To sign up for Barno and Bensahel’s Strategic Outpost newsletter, where you can track their articles as well as their public events, click here.

Image: U.S. Marine Corps