The words President Trump delivered at the Republican National Convention on Thursday night were presumably in large part those of Stephen Miller, “the worst speechwriter in modern White House history,” journalist Tim O’Brien tweeted as the president spoke, “incapable of embracing any thoughts other than carnage, conflict and chaos.”

But if such thoughts make Miller the “worst,” they also make him the right speechwriter for Trump. Miller, in addition to wordsmithing for the president, is the architect of his most protested policies — the Muslim ban and the systematic separation of migrant families at the border. The two men are simpatico, and that is critical to Miller’s longevity in a White House known for its chaotic turnover.

It’s not the only reason, however, Miller has outlasted just about every other adviser who isn’t related to the boss. Three factors play as important a role: Miller is comfortable in Trump’s shadow; he understands Trump as few others do; and he is crucial to the president’s message and success.

That Miller is content in the president’s shadow might be the most important of the three factors that explain why he remains long after others have gone. He never destabilizes Trump’s sense of superiority. He casts himself as a mere acolyte — a devoted vehicle for his boss’s agenda. Stephen K. Bannon, Miller’s former mentor and Trump’s one-time chief strategist, made the mistake of self-mythologizing in the media, posing for the cover of TIME under the words, “The Great Manipulator.” Bannon also ridiculed Trump’s daughter Ivanka and son-in-law, Jared Kushner. Miller never allowed his ideology to put him at odds with Trump’s family, perhaps intuiting that doing so would offend Trump’s ego.

Miller is an anti-immigration fanatic, but his relationship with Trump transcends that. Jeff Sessions, Miller’s former boss in the Senate and one-time attorney general, recused himself from the Russia investigation, allowing ethics to supersede loyalty. Others vented about Trump in private. Miller is 100 percent loyal to Trump 100 percent of the time.

In interviews with the media, Miller lavishes praise on his boss. “Every day of my life I thank God for having the privilege to come and work here for this president and this mission,” he told The Washington Post’s Nick Miroff. “And you cannot understand me, you cannot understand anything that I say, do or think if you do not understand that my sole motivation is to serve this president and this country.”

From his first day working for Trump, Miller has demonstrated his near-religious faith. It began with meticulous unpaid labor in 2015: writing an immigration policy plan and sending talking points several months before he was hired as senior policy adviser and speechwriter for the campaign. At rallies, he gave warm-up speeches depicting Trump as a man with godlike powers who would “save” the country.

In the White House, Miller has dominated people by channeling Trump. “He was always speaking for the president,” a former official told me when I was writing my new biography, for which I interviewed more than 100 people who know Miller and reviewed hundreds of pages of documents, including court records from his childhood and private records between Miller and his mentors. “I’ve never seen a president personally invoked so much, as in like, ‘He believes this, and irrespective of what the facts and evidence suggest, we will all organize ourselves around this belief,’ ” the former official said.

The power this channeling gave Miller became clear in early 2017, when he went to work destroying the refugee admissions system by invoking Trump’s desires and demands. At a meeting that March about a coming report on the cost of refugees, Miller told those present, according to the former official: “The president believes that it costs too much to resettle refugees — this report shall not embarrass the president.” Many officials were afraid to challenge Miller because of his constant citing of Trump. He succeeded in slashing refugee admissions to historic lows. (Miller himself did not respond to my repeated requests for interviews over the six months I was writing the book.)

People came to understand his special relationship with Trump. At a 2018 meeting led by then-national security adviser H.R. McMaster with Cabinet secretaries about an international agreement to humanely address the global migration crises, Miller launched into a speech about his opposition to it. A former official who was in the room described the scene this way: Miller looked across the table and enunciated each word, “Is there seriously anyone sitting along this table who believes that the United States should participate in this process?” The Cabinet secretaries were stone silent, shrinking in the face of his question. His personification of the president was enough to pressure them. They voted to disengage.

The second factor involves Miller’s rare understanding of Trump, which may derive in part from shared aspects of their opposite-coast backgrounds. Their families have relevant parallels. Miller’s father, a real estate investor, was tangled up in bankruptcies and legal and family financial disputes during Miller’s Los Angeles childhood. Court records describe Michael Miller as a “masterpiece of evasion and manipulation.” He unsuccessfully sued his former law partner, David Stern.

“Some people, when confronted with a problem, try to resolve it,” Stern told me. “Others, like our president, like Stephen Miller, double and quadruple down. Michael definitely comes from the double- and quadruple-down school.”

In her book, the president’s estranged niece Mary Trump describes how her grandfather taught Donald Trump to be a “killer”; some of Miller’s relatives say he, too, learned to be combative from his father, and his win-at-all-costs approach showed up early. Middle school students who shared a Hebrew class with him described an ethics debate about how to split a slice of pizza fairly. Miller reached forward and placed his palm on the slice, ending discussion.

Miller grasps Trump’s grudges and goals. His favorite place is Las Vegas. Miller repeatedly dressed up as Robert De Niro’s mobster character from the movie “Casino” on trips to Vegas with his family and friends — I’ve seen the photographs. A close friend of Miller’s told me he idolized Trump for the same reasons he idolized mobsters. They embodied power.

Both Miller and Trump have publicly expressed their desire to inflict pain and death on certain criminals. When five Black and Latino youths were falsely accused of beating and raping a White woman in Central Park in 1989, Trump paid for full-page ads before their wrongful conviction, calling for the “crazed misfits” to be executed. “I want to hate these muggers and murderers,” he wrote. At Duke University in 2005, Miller wrote in favor of the death penalty, saying he’d take rapists apart “piece by piece.”

The two men share a taste for the morbid. Miller repeatedly inserts gory descriptions of alleged migrant crimes into Trump’s statements, with references to crushed skulls and butchered little girls. He consistently pushes Trump in the most aggressive direction — which Trump appreciates. He appeals to his most violent, most ingrained impulses. Miller wanted Trump to end DACA, the Obama-era program that protected migrants brought to the United States as children. Trump was open to maintaining protections for the so-called Dreamers, whose stories he knew struck a chord with many Americans. But he trusted Miller’s feel for the hard-liners who’d helped elect him. He ended the program.

Finally, Miller is close to essential to Trump, who might not have won in 2016 without him. He gave Trump credibility with immigration hard-liners when Trump’s only immigration proposal was a wall; for decades, border barriers had underwhelmed in their ability to deter immigration, and hard-liners rolled their eyes. But then came Miller, who derived policies from think tanks like the Federation for American Immigration Reform. FAIR was created by the eugenicist John Tanton, who believed in population control for non-White people. With Miller at Trump’s side, it became clear the real accomplishment of the Trump administration could be to re-engineer the ethnic flows into the United States to keep Brown and Black families out.

Miller’s skill at demonization served him well, too, distracting from the mistakes of the administration. When federal judges halted the administration’s orders, Miller could rally people around Trump by stirring outrage about “left-wing, activist judicial rulings.” When a pandemic ravaged the economy and killed tens of thousands of Americans, Miller could summon support for Trump by scapegoating immigrants — suspending green card access and shutting down the asylum system at the border.

Miller shaped Trump’s rhetoric to echo white supremacist literature, laundering racist ideas in the language of heritage, economics and national security. For his 2020 reelection strategy, Trump is describing anti-racist protesters as “agitators and anarchists” who want to destroy America, which directly echoes the white supremacist book Miller promoted to Breitbart in 2015, “The Camp of the Saints,” which refers to the anti-racist allies of people of color as “mobs” of “agitators and anarchists” who destroy Western civilization.

Miller is tapped into Trump’s most racist base because he has been reading white supremacist literature for so long. Miller’s mentor, David Horowitz, a former Marxist-turned-right-wing radical who in 2012 successfully urged the Republican Party through Miller to remake itself around demonization and inciting fear, told me that it might have been he who introduced Miller to the digital publication American Renaissance when Miller was still a teenager in 2002. Along with other white nationalist thinking, American Renaissance publishes misleading crime statistics painting Black and Brown people as more innately violent than White people.

Trump won in 2016 by rallying white fear with Miller’s help. He knows he needs Miller for that in 2020.