Both major parties will be relieved by the results of Tuesday’s primary elections, which took place in eight states. Most candidates endorsed by party leaders prevailed, and in California’s “jungle primary,” in which the top two candidates move on to the general election regardless of party affiliation, Democrats and Republicans narrowly escaped being shut out of key races. As attention switches to November, Donald Trump’s low approval ratings and the history of midterm elections suggest that Democrats are likely to gain ground, particularly in the House. But Republicans are taking comfort in a favorable political map in the Senate, a closing of the gap between the two parties in generic-ballot polling, and—most of all—a buoyant U.S. economy.

“The economy is booming, and it’s been fueled by the pro-growth policies of the Trump administration and Republicans in Congress,” the Republican National Committee crowed in a blog post after Friday’s employment report showed that the jobless rate had fallen to 3.8 per cent in May. “In 5 short months, voters will go to the polls and support the party that’s delivering on its promises, not the party of doom and gloom whose sole mission is to resist at every turn.”

To gain a majority in the House, the Democrats need to pick up twenty-three seats. To gain control of the Senate, they need to pick up two seats. “I think right now that the numbers point to the Democrats gaining a bunch of seats in the House, but it might or might not be enough to take them to a majority. There is a lot of uncertainty,” Alan Abramowitz, an Emory University political scientist who has been studying and modelling election results for decades, told me on Monday. “The outcome in the Senate is even less clear. There’s even more uncertainty there.”

Other observers broadly agree with Abramowitz. “Both Democrats and Republicans have about equal odds of winning the House majority,” Kyle Kondik, the managing editor of Sabato’s Crystal Ball, wrote over the weekend. On Wednesday afternoon, PredictWise, the analytics site, put the probability of the Democrats gaining a majority at fifty-seven per cent, which also indicates that the contest is close. As for the Senate, PredictWise said that the Republicans have a seventy-one-per-cent chance of retaining control.

To be sure, it’s still early, and polls and prediction algorithms can be unreliable. In a series of recent special elections in states including Alabama and Pennsylvania, where actual votes were cast, Democratic candidates, buoyed by an impressive anti-Trump grassroots movement, have performed extremely well. And at least in some places, such as New Jersey and Iowa, Democratic turnout was very strong on Tuesday, too, which augurs well for November.

That’s encouraging for Democrats, but, as the summer proceeds, the Republicans may well have more good economic news to tout. New statistics released by the government indicate that spending on American goods and services has been picking up pace from the first three months of the year, when G.D.P. expanded at an annual rate of 2.2 per cent, according to the Commerce Department. “Q2 is shaping up to be off the charts, with growth of four per cent. It might even approach five per cent,” Ian Shepherdson, the chief U.S. economist at Pantheon Macroeconomics, told me on Wednesday. By Election Day, Shepherdson added, the unemployment rate could be down to 3.6 per cent, its lowest level since 1969.

Other forecasters aren’t quite that optimistic, but almost all of them are revising their estimates as more upbeat reports come in. Goldman Sachs is predicting growth of 3.7 per cent. Macroeconomic Advisers is predicting 3.6 per cent. The Commerce Department will provide its initial estimate of the actual figure on July 27th. If it’s as strong as expected, Republican candidates are sure to seize on it, as is Trump, who claimed on Twitter earlier this week, “In many ways this is the greatest economy in the HISTORY of America.”

That was a typical Trump fabrication. To be sure, the fall in the official jobless rate is good news. But other important labor-market measures, such as the proportion of the population aged twenty-five to fifty-four that is working, are still below their 2007 levels. Economic growth was much stronger in the late nineties and mid-eighties, not to mention the postwar boom of the fifties and sixties.

In the ninth year of an economic upturn that Trump inherited from Barack Obama, wage growth is still modest, and median household income is barely above the level it reached during the nineties boom years. Wage and wealth inequality are higher than they have been in at least a half century. The Republican tax bill will only accentuate these trends, and it is already undermining public finances. With tax revenues running well short of federal spending, the Congressional Budget Office is now forecasting rising budget deficits and debt levels far into the future.

In addition, Trump’s quixotic trade war could end up undermining one of the key sources of the economy’s current strength. Foreign trade has turned out to be a big driver of rapid growth in the second quarter, Shepherdson said. On Wednesday, the Commerce Department reported that the trade deficit fell to a seven-month low in April. Imports fell back following a recent spike, and exports rose to a record high.

Whatever happens on the trade front, the current rates of economic growth are unlikely to last long. As the impact of the tax cut fades and the Fed continues to raise interest rates, most analysts expect G.D.P. growth to slow down in the third and fourth quarters of this year. “The current pace is probably as good as it gets because we expect the impulse from financial conditions to gradually turn more negative,” Jan Hatzius, the chief economist at Goldman, pointed out in a research note earlier this week.

Further Reading New Yorker writers on the 2018 midterm elections.

In short, the Democrats have some strong arguments they can make to counter the Republican claim that everything is tickety-boo. Moreover, there are plenty of historical precedents for the party in the White House losing many seats in the midterms, despite a healthy-seeming economy. “In 1966, the economy was strong and the Democrats lost a whole bunch of seats,” Abramowitz said. The 2006 midterms provide a more recent example. In 2005 and 2006, the economy expanded pretty strongly, and the unemployment rate fell to 4.4 per cent. But, after public disquiet about the Iraq War and the federal response to Hurricane Katrina sent George W. Bush’s approval rating plummeting, the Republicans lost control of the House and the Senate. It was a Democratic-wave election.

History could repeat itself. Despite a recent uptick in Trump’s approval rating, it was still just forty one per cent in the latest Gallup survey. Given Trump’s unpopularity, it makes sense for Democrats to portray the midterms as an opportunity to restrain him, and perhaps even to impeach him. But Democrats will also have to contend with Republican efforts to distract from Trump’s manifest unfitness for office. It’s now clear that these efforts will focus on the economy. Democrats will need to hone their economic message, too—not as a substitute for attacking Trump but as a supplement to it.

At the local level, many Democratic candidates are already doing this effectively, talking about issues like wages, childcare, the G.O.P.’s attack on Medicaid and Medicare, and how Republicans slanted their tax bill toward the ultra-rich. That is the best way to expose the hypocrisy of Trump and the Republicans. Now it’s up to Democrats at the national level to hammer home the same message.

This post was updated to clarify the number of seats the Democrats need to pick up for a majority.