President Biden appears behind in all the swing states and his campaign appears all-too-focused on firming up his political base on the left with his new shift on Israel, a $7 trillion budget, massive tax increases and failing to connect on the basic issues of inflation, immigration and energy. By pitching too much to the base, he is leaving behind the centrist swing voters who shift between parties from election to election and, I believe, will be the key factor deciding the 2024 race.

I’ve spent decades looking at the behavior of swing voters and how candidates appeal to them, including for Bill Clinton’s re-election campaign in 1996. If Mr. Biden wants to serve another four years, he has to stop being dragged to the left and chart a different course closer to the center that appeals to those voters who favor bipartisan compromises to our core issues, fiscal discipline and a strong America.

People usually assume that turning out so-called base voters in an election matters most, since swing voters are fewer in number. And it’s true that in today’s polarized environment, Mr. Biden and Mr. Trump each has about 40 percent of the country in their bases already and nothing will change those people’s minds. But in that remaining 20 percent of the electorate, swing voters have disproportionate power because of their potential to switch. It’s simple math: Take an electorate of 10 voters in an election tied 5 to 5. If one voter swings, the margin becomes 6 to 4. Two voters then need to be turned out just to tie it up and a third one is needed to win.

The simple power of this math — which drove the campaigns of Mr. Clinton (with his message about “building a bridge to the 21st century”), George W. Bush (“compassionate conservatism”) and Barack Obama (“hope and change”) — has been obscured, undoubtedly by base groups like unions or PACs that have a vested interest in maintaining their sway and power. Take Michigan, a battleground state where Mr. Trump has led Mr. Biden by as many as three percentage points in the last month. To overcome that gap, Mr. Biden would need to bring out nearly 250,000 additional voters (3 percent of more than eight million registered voters) just to tie it up in a state that has already achieved a record of over 70 percent turnout in a presidential year. Or Mr. Biden could switch just 125,000 swing voters and win.

Despite this math, scared candidates are, in my experience, easily sold the idea that the Democratic base or Republican base is going to stay home in November unless they are constantly fed what they want to hear. One call from the head of a religious group, a civil rights group, a labor group and others (often called “the groups”) and fear runs through a campaign. A New York Times article this winter about Black pastors warning the Biden White House that his Gaza war policy could imperil re-election is a good example. Maybe if Mr. Biden were running against a well-liked centrist opponent, concern could be justified. But during a fall election against Mr. Trump, the final month of this campaign is going to see a frenzy of get-out-the-vote efforts, and I doubt the Democratic base is going to sit idly by at the thought of the Trump limo cruising up Pennsylvania Ave. The reality is that swing voters in battleground states who are upset about immigration, inflation, what they see as extreme climate policies, and weakness in foreign affairs are likely to put Mr. Trump back in office if they are not blunted.

Consider some Democratic electoral history. Joe Biden got 81 percent of the vote in the Michigan Democratic presidential primary in February. He got roughly similar percentages in the Colorado, Texas and Massachusetts primaries — not too far below other incumbent presidents with a weak job rating. And yet for months, liberal commentators and activists pointed to the Michigan protest vote as proof that Mr. Biden is doomed in November over his Israel stance. But Michigan was hardly a repeat of the 1968 New Hampshire primary that effectively ended Lyndon Johnson’s re-election bid — Eugene McCarthy got 42 percent and that was a truly sizeable protest.