France didn’t schedule a referendum on its membership in the European Union or globalization writ large, but it is about to get one. The first round of the country’s presidential elections, which will be held this Sunday, has become impossible to handicap. France’s party system is in its death throes, according to Patrick Buisson, a onetime top adviser to former President Nicolas Sarkozy. “Like all death throes,” Mr. Buisson said recently over a brasserie lunch in Paris, “it is convulsive.”

Sunday’s top two vote-getters will advance to a second round on May 7. Polls now show four candidates locked in a dead heat. Put bluntly, the contenders are a capitalist, a Catholic, a nationalist and a leftist. The 39-year-old Emmanuel Macron, a former investment banker and economics minister, bolted the Socialist Party last year to run at the head of a new movement called En Marche (“on the march”). He wants to strengthen the 28-country European Union, which lays down rules for the continent. In an ordinary year, he might be preparing to run head-to-head against the conservative François Fillon, whose mostly Catholic political base has rallied against Islamist terrorism and gay marriage. But Mr. Fillon has spent the entire campaign mired in featherbedding scandals.

One or both of these mainstream candidates could be toppled by an insurgency. If that happens, much else will fall. Marine Le Pen, the daughter and political heiress of the demagogue Jean-Marie Le Pen, has sought to purge his National Front of its reputation for bigotry. She wants to pull France out of the EU entirely. The eloquent Jean-Luc Mélenchon is almost as skeptical about the EU, even if his own sympathies are more with South American radicals such as Evo Morales and the late Hugo Chávez.

In France and elsewhere, citizens complain that the EU has eroded their culture, sapped their defenses against mass migration and left them less free; meanwhile, business leaders and the politicians they back call it indispensable.

Globalization has left mixed results in France. Its major cities, starting with Paris, are as rich as ever, but they have been hit hard by terrorism. In just the past two years, the staff of the satirical weekly Charlie Hebdo were massacred for belittling Islam, dozens of music fans were executed at a concert hall in Paris, tourists were mowed down by a truck on the beachfront of Nice, and an 84-year-old priest had his throat slit after celebrating Mass near Rouen. On Thursday, a gunman killed one police officer and wounded two others on the Champs-Élysées, in an act claimed by Islamic State.