The warning signs are everywhere. For 30 years, polls showed that Americans trusted Democrats over Republicans to invest in public education and strengthen schools. Within the past year, however, Republicans have closed the gap; a recent poll shows the two parties separated on the issue by less than the margin of error.Since the Republican Glenn Youngkin scored an upset win in Virginia’s race for governor by making education a central campaign issue, Republicans in state after state have capitalized on anger over mask mandates, parental rights and teaching about race, and their strategy seems to be working. The culture wars now threatening to consume American schools have produced an unlikely coalition — one that includes populists on the right and a growing number of affluent, educated white parents on the left. Both groups are increasingly at odds with the Democratic Party.For the party leaders tasked with crafting a midterm strategy, this development should set off alarms. Voters who feel looked down on by elites are now finding common cause with those elites, forming an alliance that could not only cost the Democrats the midterm elections but also fundamentally realign American politics.The Democrats know they have a problem. One recent analysis conducted by the Democratic Governors Association put it bluntly: “We need to retake education as a winning issue.” But reclaiming their trustworthiness on education will require more than just savvier messaging. Democrats are going to need to rethink a core assumption: that education is the key to addressing economic inequality.The party’s current education problem reflects a misguided policy shift made decades ago. Eager to reclaim the political center, Democratic politicians increasingly framed education, rather than labor unions or a progressive tax code, as the answer to many of our economic problems, embracing what Barack Obama would later call “ladders of opportunity,” such as “good” public schools and college degrees, which would offer a “hand up” rather than a handout. Bill Clinton famously pronounced, “What you earn depends on what you learn.”But this message has proved to be deeply alienating to the people who once made up the core of the party. As the philosopher Michael Sandel wrote in his recent book “The Tyranny of Merit,” Democrats often seemed to imply that people whose living standards were declining had only themselves to blame. Meanwhile, more affluent voters were congratulated for their smarts and hard work. Tired of being told to pick themselves up and go to college, working people increasingly turned against the Democrats.Today, as the middle class falls further behind the wealthy, the belief in education as the sole remedy for economic inequality appears more and more misguided. And yet, because Democrats have spent the past 30 years framing schooling as the surest route to the good life, any attempt to make our education system fairer is met with fierce resistance from affluent liberals worried that Democratic reforms might threaten their carefully laid plans to help their children get ahead.In California, plans to place less emphasis on calculus in an effort to address persistent racial and socioeconomic disparities in math achievement have spawned furious backlash. So, too, did the announcement last fall that New York City schools would be winding down their gifted and talented program, which has been widely criticized for exacerbating segregation — an announcement that Mayor Eric Adams has begun to walk back.Mr. Youngkin was one of the first to recognize that these anxieties could be used for political gain, and he carefully tailored his messaging to parents from both affluent families and the conservative movement. In his appeals to the Republican base, he railed against critical race theory and claimed that allies of George Soros had inserted “operatives” on local school boards. To centrist parents, he pledged to undo admissions policy changes aimed at bolstering diversity at Virginia’s prestigious Thomas Jefferson High School for Science and Technology, where graduates regularly go on to attend Ivy League universities.These promises seem to have worked. A recent focus group conducted by a Democratic polling firm showed that education was the top issue cited by Joe Biden supporters who had voted or considered voting for Mr. Youngkin. Participants referred to an array of complaints about education, including a sense that the focus on race and social justice in Virginia’s schools had gone too far, eclipsing core academic subjects. Similar charges echoed through the San Francisco school board election last month as Asian American voters, furious over changes to the admissions process at a highly selective high school, galvanized a movement to oust three school board members.How can Democrats claw out of this bind? In the near term, they can remind voters that Republican efforts to limit what kids are taught in school will hurt students, no matter their background. The College Board’s Advanced Placement program, for example, recently warned that it will remove the AP designation from courses when required topics are banned. Whatever the limitations of the AP program, students from all class backgrounds still use it to earn college credit and demonstrate engagement in rigorous coursework. Democrats could also take a page from Mr. Youngkin’s playbook and pledge, as he did, to invest more “than has ever been invested in education,” an issue that resonates across party lines.But if Democrats want to stop bleeding working-class votes, they need to begin telling a different story about education and what schools can and can’t do. For a generation, Democrats have framed a college degree as the main path to economic mobility, a foolproof way to expand the middle class. But now kids regularly emerge from college burdened with crushing student debt and struggling to find stable jobs. To these graduates and to their parents it is painfully obvious that degrees do not necessarily guarantee success. A generation ago, Mr. Clinton may have been able to make a convincing case that education could solve all people’s problems, but today Democrats risk irrelevance — or worse — by sticking with that tired mantra.So, yes, strong schools are essential for the health and well-being of young people: Schools are where they gain confidence in themselves and build relationships with adults and with one another, where they learn about the world and begin to imagine life beyond their neighborhoods. But schools can’t level a playing field marred by racial inequality and increasingly sharp class distinctions; to pretend otherwise is both bad policy and bad politics. Moreover, the idea that schools alone can foster equal opportunity is a dangerous form of magical thinking that not only justifies existing inequality but also exacerbates our political differences by pitting the winners in our economy against the losers.Democrats can reclaim education as a winning issue. They might even be able to carve out some badly needed common ground, bridging the gap between those who have college degrees and those who don’t by telling a more compelling story about why we have public education in this country. But that story must go beyond the scramble for social mobility if the party is to win back some of the working people it has lost over the past few decades.Schools may not be able to solve inequality. But they can give young people a common set of social and civic values, as well as the kind of education that is valuable in its own right and not merely as a means to an end. We don’t fund education with our tax dollars to wash our hands of whatever we might owe to the next generation. Instead, we do it to strengthen our communities — by preparing students for the wide range of roles they will inevitably play as equal members of a democratic society.Jennifer Berkshire (@BisforBerkshire) is a freelance journalist, and Jack Schneider (@Edu_Historian) is an associate professor of education at the University of Massachusetts Lowell. They are the authors of “A Wolf at the Schoolhouse Door: The Dismantling of Public Education and the Future of School” and the hosts of the education policy podcast “Have You Heard.”The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram. More