Washington (CNN) Last summer when Sen. Dean Heller was considering bucking President Donald Trump on health care, the president issued a not-so-subtle threat to the vulnerable Nevada Republican.

"Look, he wants to remain a senator, doesn't he?" Trump said at a meeting at the White House with GOP senators.

Heller laughed off the comment, but GOP senators were alarmed. And the subtle threat may have had an effect.

Over the next several months, Heller aligned himself closely with the President, endorsing his efforts to repeal Obamacare, appearing right behind Trump at a White House event celebrating passage of the tax law, and avoiding direct criticism of Trump despite the seemingly endless string of controversies coming out of the West Wing.

And the White House returned the favor, endorsing Heller in his reelection bid, with plans to dispatch Vice President Mike Pence to Nevada twice by spring. And this week, he delivered perhaps the biggest gift of all: The President helped clear the field by convincing Heller's primary foe, Danny Tarkanian, to run for the House instead.

The President's maneuvering in Nevada underscores this reality about Trump: Despite his polarizing presidency, the special counsel investigation clouding his administration and his historically low approval ratings, he remains the most powerful player in Republican primary politics, with the ability to influence the course of a race with a simple tweet.

Indeed, his tweet endorsing Sen. Roger Wicker undercut a primary foe just as he was preparing a challenge in Mississippi. A tweet praising a challenger to his critic, Jeff Flake, preceded the Arizona Republican's decision to quit a primary race that may have been unwinnable.

And as Sen. Bob Corker was weighing whether to abandon his decision to retire and run again for reelection, Trump would not commit to supporting the Tennessee Republican, making it clear that Corker would have to fight a tough primary challenger to win back his seat. Corker opted to retire instead.

All of this explains why Trump has been able to get his way with Republicans in Congress, who are not eager to go toe-to-toe publicly with Trump no matter how they may privately feel.

Mark Meadows, head of the House Freedom Caucus, told CNN that the base pushes back when an unpopular Congress fights with Trump.

They see certain senators "as part of the problem" and the more they criticize Trump, "the more the base likes him," Meadows said.

Heller's relationship with Trump began improving after the two talked on an Air Force One flight to Las Vegas after the shooting there in October. Since then, Heller has avoided criticizing Trump and Trump has returned the favor by intervening to spare him a primary challenge.

Tarkanian told CNN that Trump 2020 campaign manager Brad Parscale called Wednesday night -- less than two days before Nevada's filing deadline -- to say that Trump wanted him out of the Senate race.

"He said it'd be best for party unity, best chance to get his 'America First' agenda passed," Tarkanian said.

Tarkanian said he spoke with his wife and mother, and then campaign staff and volunteers, on Thursday morning. "Every single one of them said, 'You ought to do what the President's asking you to do and get into CD-3,'" he said.

But he still had reservations. His entire campaign had been fueled by the premise that Heller was insufficiently loyal to Trump. So Tarkanian called Parscale back later Thursday and told him he needed a public indication that Trump would have his back if he exited the Senate primary and ran for the 3rd District House seat instead.

"I hadn't talked with the President. How would I know it?" he said. "This was not my idea to do this. This is the President's idea, and I think it was important that people know that. Plus, it was important that I know it."

On Friday, hours before the filing deadline, Trump tweeted: "It would be great for the Republican Party of Nevada, and it's unity if good guy Danny Tarkanian would run for Congress and Dean Heller, who is doing a really good job, could run for Senate unopposed!"

Almost immediately, Tarkanian's wife Amy responded that he would abide by Trump's wishes. And Heller, now in Trump's good graces, has a clear path through the primary.

Republicans who aren't willing to cozy up to Trump, meanwhile, are opting for retirement in 2018 rather than uphill reelection battles in a challenging political environment.

Meadows told CNN Friday that Trump is just as popular in his district as he was in November 2016 when he carried his North Carolina district by roughly 25 points. He said voters repeatedly tell him to tell Trump to "keep up the fight."

Trump has long valued loyalty above almost anything else, according to people close to him. And that has often gotten him in hot water, including when he allegedly asked James Comey for loyalty before he was fired as FBI Director, something Trump has denied.

But senators, too, have tried have tried to influence Trump by praising him and getting on his good side.

"It's not the content of your character" that matters, said Sen. Lindsey Graham, a one-time foe turned friend of Trump's. "It's whether or not you show him respect and like him."