The high-profile battle between Sen. Elizabeth Warren (D-Mass.) and now-Attorney General Jeff Sessions would never have happened if both had not, earlier in their careers, been blocked from jobs they wanted by strong opposition in the Senate.

Sessions’s story of being denied a federal judgeship is well known, and it was reprised after Warren was prevented from reading Coretta Scott King’s letter of opposition to Sessions’s 1986 nomination.

The more recent impediment of Warren was instructive, too.

After the passage of the Dodd-Frank financial reform law, Warren, who had advocated for the creation of the Consumer Finance Protection Bureau under the law and worked with the Obama administration to set it up, was seen as the obvious candidate to run the CFPB.

But in 2011, Republicans held 47 Senate seats, and the filibuster rules of that time allowed them to block any nominee who could not earn every Democratic vote and seven of their own. Republicans made it clear that they would not confirm Warren unless the CFPB was scaled back — something Democrats would never do. In May 2011, all 47 Republicans signed a letter promising to block a recess appointment to the CFPB. The letter’s chief author — in small irony — was then-Sen. Jeff Sessions.

“Never in history had a minority in the Senate ‘pre-rejected’ a presidential nominee just because they didn’t like the agency he or she was due to run,” Warren wrote in her 2014 memoir, “A Fighting Chance.” “Progressives were outraged, and a number argued that this was the right moment for the president to fight back: He should nominate me, have a showdown with the Senate Republicans, and then, if needed, make a recess appointment.”

That didn’t happen. The Obama White House made what seemed, at the time, to be a compromise with Republicans — Warren would not be nominated, replaced by former Ohio attorney general Richard Cordray, whom Warren had hired to run the CFPB’s enforcement arm.

Not becoming the CFPB director freed Warren to run for the Senate. Had Republicans let her take the CFPB job — a compromise that would have alienated plenty of donors, who considered Warren a threat — Democrats might not have found a strong enough candidate to unseat Massachusetts’s then-senator, Scott Brown.

The full-court press in 2011 is also instructive about Republican messaging in 2017.

Some of President Trump’s most popular campaign rhetoric was purloined from Warren: Where she said that “the system is rigged,” referring to the financial system, Trump pronounced a whole “globalist” system rigged against the working class.

On the other hand, Republicans have attempted to portray Warren as a left-wing, alienating figure. They’ve latched onto a poll from early January that found 51 percent of Massachusetts voters viewing Warren favorably and just 44 percent saying she “deserves reelection” in 2018. America Rising, the pro-Republican opposition research group, has focused an unusual amount of fire on Warren, whose state gave just 33 percent its vote to Trump last year.

In conservative media, it’s widely accepted that raising Warren’s profile will be bad for Democrats: A Fox Business segment on Wednesday featured host Stuart Varney calling her “the outspoken socialist senator from Massachusetts” and assuring that “Democrats are making a mistake by putting Senator Warren out front in a very attacking, moralistic mode.”

For some, it’s easier to think that Republicans cleverly elevated Warren to tie Democrats to “the left” than it is to believe that they have repeatedly stumbled and elevated her as an effective opponent. But that largely relies on a equivalence of the “right” and “left” as equally extreme, and equally upsetting to centrist voters, and that might not reflect reality. In December, for example, Morning Consult asked a polling sample of Trump voters if they favored elimination of the Consumer Finance Protection Bureau: 50 percent of Trump voters wanted it expanded or left alone; just 7 percent agreed with nearly every Republican politician in calling for it to be scrapped.

And recent history suggests that partisans are not always the best judges of what the opposition might do to alienate voters. The hack of John Podesta’s email recovered a memo from April 23, 2015, from Hillary Clinton’s pre-campaign organization to the Democratic National Committee. Among the early goals of any campaign, they believed, was to “force all Republican candidates to lock themselves into extreme conservative positions that will hurt them in a general election.”

“We don’t want to marginalize the more extreme candidates,” wrote the memo authors, “but make them more ‘Pied Piper’ candidates who actually represent the mainstream of the Republican Party.”

Three candidates were named: Sen. Ted Cruz (R-Tex.), Ben Carson and Donald Trump.