RALEIGH — With an unpopular president in the White House, a spate of incumbent retirements in competitive seats, and a relentless drumbeat of media hits against them, Republicans are clearly heading into a risky election cycle. So why are GOP leaders, particularly here in North Carolina, feeling cautiously optimistic about the 2018 midterms?

There are at least three reasons: money, maps, and momentum.

In the crucial General Assembly races, for example, House Speaker Tim Moore, Senate leader Phil Berger, and Republicans as a whole will almost certainly have a substantial fundraising edge over their Democratic counterparts. Even factoring in the expected flood of independent expenditures against them, GOP candidates will have sufficient resources to get their message out.

With regard to the maps, successful lawsuits by progressive and Democratic plaintiffs did force the redrawing of some legislative districts in Guilford County and the Sandhills. But Republican-drawn districts remain in place in Wake and Mecklenburg counties, where Democrats had their greatest hopes of making big gains.

As for momentum, the latest public opinion polls reflect a bit of a bounce in the Republican direction. In new North Carolina surveys from Meredith College, High Point University, and the Civitas Institute, for example, the “generic ballot” questions — which ask respondents which party’s congressional or legislative candidates they plan to vote for, without naming the candidates — all produced statistical dead heats. These results are simply not consistent with predictions of a large Democratic wave.

How could this be? If you look at the other questions in the statewide polls, you see that respondents are more upbeat about North Carolina than they have been in the recent past — and are more upbeat about their state than about the nation as a whole. Public dissatisfaction powers votes against incumbents. North Carolina Democrats will probably need more of it by the fall to topple incumbent Republicans or capture open seats.

Another factor is that the tax reform bill enacted by Republicans in Congress and signed by President Trump is gaining popularity. Polling for the New York Times found that while only 37 percent of Americans supported the bill in December, 51 percent favored it by February. As withholding adjustments give workers more take-home pay and groups favoring the tax measure ramp up their marketing over the coming weeks and months, public support may well continue to rise.

These are reasons for guarded optimism by Republicans, not for exultation. History is not on their side. Electoral politics is about ebbs and flows. Usually (but not always), the party that controls the White House loses seats in the midterms.

More specifically, if you look at modern political history in North Carolina, there have been six instances when a Republican was president and a Democrat was governor. On average, Republicans lost six legislative seats over those cycles. If you exclude the obvious outlier — the wartime 2002 cycle when President George W. Bush enjoyed high approval ratings — the average GOP loss was nine seats.

It’s worth pointing out that these elections all occurred with district maps drawn to favor Democrats (yes, kids, gerrymandering predates 2011) and with massive Democratic advantages in fundraising. The current situation is different. Still, even modest seat losses could endanger the GOP’s supermajorities in the North Carolina House (75 of 120 seats) or Senate (35 of 50 seats).

There is one other factor that could hinder Democratic gains. While some of the party’s recruits for competitive congressional and legislative seats are impressive and potentially attractive to swing voters, others are, to be blunt, far to the left of the median voter. This is not the Democratic Party even of the 2000s, when moderate candidates such as Heath Shuler got the party’s nod in key districts.

No one really knows, of course, what’s going to happen this fall. If progressive Democrats win lots of seats, they’ll give Republicans in Raleigh and Washington lots of headaches. But if Democrats fall short of expectations, the party’s deep-blue shift will deserve at least part of the blame.

John Hood (@JohnHoodNC) is chairman of the John Locke Foundation and appears on “NC SPIN,” broadcast statewide Fridays at 7:30 p.m. and Sundays at 12:30 p.m. on UNC-TV.