H.R. McMaster, an active-duty Army general, will be President Donald Trump’s next national security adviser, according to an announcement on Monday afternoon. McMaster isn’t exactly a household name, but he’s well-known among observers of the US military — and has a sterling reputation as a strategist, leader, and intellectual.

McMaster’s predecessor, retired Gen. Michael Flynn, had a (seemingly justified) reputation for being a loose cannon attracted to fringe political ideas. McMaster is the opposite — a careful scholar and successful general who’s well-regarded in the Washington foreign policy establishment. That’s why even some Trump critics, like former Obama Defense Department official Andrew Exum, are praising the pick.

“He is one of the most talented men I know,” Exum tweeted. “A great officer and thinker. Huge upgrade. “

In theory, McMaster is a good person to do the core job of the national security adviser: help Trump sort through information and develop his policies accordingly. In practice, it’s far from clear how much influence McMaster will actually have over a president who seems deeply skeptical of people outside his immediate circle and information that troubles his basic worldview.

McMaster was an excellent officer

McMaster’s public record for the past 25 years has been pretty striking.

During the Gulf War, he served as a captain of an armored cavalry troop (a mixed group of tanks and other fighting vehicles). During the invasion, McMaster’s Eagle Troop ran into an elite group of Saddam’s tanks hidden by a sandstorm — and routed them without suffering a single casualty.

After the war, McMaster enrolled in a history PhD program at the University of North Carolina, something ambitious military officers do now with relative frequency. In 1997, he published his dissertation — on the US military’s role in helping begin the Vietnam War. In the book, McMaster argues that the incompetence of and internal divisions among the country’s leading officers, the Joint Chiefs of Staff, allowed President Johnson and his civilian advisers to get trapped in an unwinnable war.

The book was well-reviewed; George Washington University Ronald Spector, writing for the New York Times, called it “a comprehensive, balanced and relentless exploration of the specific role of the Joint Chiefs of Staff.” The book helped win McMaster a reputation as both a capable soldier and a talented scholar.

In 2005, then-Col. McMaster deployed to Iraq, tasked with pacifying the insurgent-ridden city of Tal Afar. Unlike many generals at the time, McMaster emphasized Arabic language skills and interfacing with Iraqi civilians, on the theory that insurgents can’t survive without a friendly population to hide in. Foreign Policy’s Tom Ricks recalls McMaster’s time in Iraq thusly:

I remember him telling his soldiers that understanding counterinsurgency really wasn’t hard: “Every time you disrespect an Iraqi, you’re working for the enemy.” They even had “Customer Satisfaction Forms” that detainees were asked to fill out upon release: Were you treated well? How was the food? What could we do better?

McMaster’s approach, as Ricks recalled, worked — he had established control over the city, with cooperation from local authorities, by the end of the year.

Despite this relatively impressive record, though, McMaster reportedly had some trouble climbing to the higher ranks of the US military, which his admirers attribute his willingness to speak his mind.

Regardless, he managed to secure an important post focusing on strategic doctrine in 2014, directing the Army’s Futures Center, where he’s served ever since. That year, Time magazine named him one of the 100 Most Influential People in the world.

If Trump was looking for a military officer to advise him, it’s hard to think of one that’s more qualified on paper.

But that doesn’t mean he’ll be a good NSA

The national security adviser is an exceptionally important post. The NSA’s key job is to help the president sort through the intelligence and policy ideas coming from various government agencies, essentially deciding what the boss sees and helping him interpret it.

Clearly, McMaster is a smart man who’s knowledgeable about the world. But this job depends, crucially, on having the president’s trust and his ear. If Trump doesn’t trust McMaster’s assessments, or if he gets into a lot of conflicts with other key Trump advisers, then he’ll have a hard time wielding a lot of influence over the president.

One of the key first issues is staffing. Retired Vice Adm. Bob Harward, Trump’s first pick for the job, turned it down — ostensibly for family reasons. But CBS News reported that there was another factor:

Two sources close to the situation confirm Harward demanded his own team, and the White House resisted. Specifically, Mr. Trump told Deputy National Security Adviser K. T. McFarland that she could retain her post, even after the ouster of National Security Adviser Michael Flynn. Harward refused to keep McFarland as his deputy, and after a day of negotiations over this and other staffing matters, Harward declined to serve as Flynn’s replacement.

It’s not surprising that Harward wouldn’t want McFarland, a Fox News personality who hadn’t been in government for two decades, as his top deputy. McMaster likely wouldn’t either — so her fate will be a clear sign as to how much influence McMaster has over the president.

“To do the job right, McMaster needs to bring in his own people,” Ricks writes. “And it remains unclear if he can get that.”

Even if McMaster gets past the staffing hurdle, he’ll still have to deal with people on the political side — most notably senior strategist Steve Bannon — many of whom share a radical anti-Islam view very much at odds with McMaster’s approach to fighting terrorism (at least if his record in Iraq is anything to go by).

The bottom line, then, is that intelligence and military skill are not necessarily the key qualities that will allow McMaster to succeed in his new role. He’ll need to figure out some way to function inside a deeply dysfunctional and divided administration. It’s not clear if anyone knows the right way to do that.