FRANKFURT — The German economy could hardly be in better shape as Angela Merkel formally begins her fourth term as chancellor Wednesday. Unemployment is almost nonexistent, stock prices are at record highs, and there is almost no inflation.

But the political compromise that allowed Ms. Merkel to remain in power could bring that boom to an end. She had to bend to demands from her party’s junior coalition partner, and agree to roll back deregulation that, since 2005, has unleashed the country’s economy.

Ms. Merkel, who will take the oath of office Wednesday along with her cabinet, faces the same political quandary afflicting many industrialized nations, including the United States. Life should feel great, but to many people, it doesn’t. Their wages haven’t budged, their jobs seem less secure, and they believe the good times have passed them by.

In Germany, where unemployment is only 3.6 percent, many angry voters in last year’s election deserted the two centrist parties, Ms. Merkel’s Christian Democrats and the left-leaning Social Democrats, in favor of minority parties, especially the far right Alternative for Germany.

“People are less confident,” said Stefan Sachs, a leader of a local chapter of the IG Metall union in the state of Hessen. “From one day to the next, you can be fired.”

To get reluctant Social Democrats to sign up for a coalition government, Ms. Merkel made concessions that critics say would take Germany back to a time when the country looked more like France, with rules that protected workers from dismissal, provided a broad safety net — and squashed entrepreneurship and growth.

The power-sharing agreement gives the Social Democrats more influence over policy than in their previous coalition, which ruled until elections last year.

In particular, Ms. Merkel ceded the Finance Ministry and control of the purse strings to the left-of-center party, which is likely to relax the strict fiscal discipline that prevailed under Wolfgang Schäuble. Mr. Schäuble, the finance minister from 2009 until he resigned last year, was a dominant figure not only in Germany but throughout Europe, where he enforced the austerity imposed on crisis countries like Greece and Portugal in return for eurozone aid. Austerity measures in the wake of the financial crisis largely involved shrinking government spending, by trimming pensions and cutting social programs, as a way to rein in budget deficits.

He also pushed those countries to emulate Germany’s reforms, in particular relaxing restrictions on hiring and firing. Many countries complied, at least to a degree, helping joblessness in the eurozone fall to 8.6 percent in February, down from more than 12 percent in 2013.

Yet now, some critics believe Berlin is on the verge of refusing its own medicine. Without Germany serving as an example, leaders in other eurozone countries would have even more trouble negotiating the politically hazardous terrain of reform.

“The coalition is undoing all the reforms that turned Germany from the sick man of Europe into the locomotive,” said Holger Schmieding, chief economist of Berenberg, a German bank.

Mr. Schmieding predicted that Germany’s relative decline would pave the way for France to take over as the eurozone’s driving force.

France is roughly where Germany was at the beginning of the 2000s, and Emmanuel Macron, the French president, has begun his own, albeit fitful, reform drive.

Although the two countries appear to have divergent narratives, Germany remains by far the eurozone’s biggest economy, and Mr. Macron will need Ms. Merkel to fulfill his regional priorities, like overhauling the European Union’s creaky machinery.

Indeed, the increased power of the Social Democrats — who have advocated greater investment spending and are resolutely pro-European — could serve to support Mr. Macron, even if Germany backtracks on economic reforms, according to Hans Stark, a professor at the Sorbonne University who studies Franco-German relations.

“It is in Germany’s interest for Mr. Macron to succeed with his reform plans,” Mr. Stark said.

Domestically, the promises exacted by the Social Democrats during difficult negotiations with Ms. Merkel would make it easier for workers at small firms to organize, allow greater increases in pensions and put limits on companies’ use of temporary workers.

That last provision is of particular concern to automakers and companies that have relied on workers with short-term contracts to deal with fluctuations in demand. Unlike permanent employees, temporary workers can be laid off without big severance payments and lengthy negotiations with labor representatives.

BMW, for example, was able to quickly react to a slump in car sales in 2008 and 2009 by cutting temporary workers. More recently, the automaker has hired workers on short-term contracts to meet a jump in orders for an S.U.V. model produced at a factory in Regensburg, Germany.

It is a tool that companies here have used liberally — temporary workers account for 9 percent of the German work force and 19 percent of workers 35 or younger.

Proponents say the system helps younger or less-qualified workers get a footing in the job market, helping them get hired full time.

But labor representatives accuse employers of abusing the system, creating a cohort of second-class workers living from one six-month contract to the next. Temporary workers are more at risk of slipping into poverty and are less likely to be married or have children, according to a study by the Hans Böckler Foundation, which is financed by German labor unions.

Ogur Özalp, a 32-year-old from the town of Schwalmstadt, about 70 miles north of Frankfurt, worked on temporary contracts for six years at an auto industry supplier, where he inspected brake parts. But, according to the IG Metall union, Mr. Özalp was fired on a pretense just before the company would have been required to hire him full time.

Under the coalition program, workers like Mr. Özalp could not make up more than 2.5 percent of a company’s work force, with some exceptions. Businesses would have to offer permanent jobs to workers on short-term contracts after 18 months, instead of 24 months under current rules. Contracts could be renewed only once rather than three times.

It remains to be seen how much of the coalition pact becomes law, and the economic effects may be milder than economists predict. Many experts warned that the government would kill job creation when it introduced a minimum wage in 2015. Unemployment continued to fall.

But there are already signs that business leaders are worried about what they see as a drift toward the sclerotic Germany of old, led by an unpopular government bereft of new ideas.

Surveys of business optimism have slipped in recent months after four years of nearly uninterrupted gains. Such pessimism can become self-fulfilling, discouraging businesses from expanding and hiring.

For the moment, Germany’s economy is so strong that few people remain unemployed for long. Still, people like Mr. Özalp often feel stuck in an endless series of insecure jobs.

He quickly found a position at another parts maker — unemployment in the region where he lives is only 4 percent. But the new job pays less and he has a contract for only six months, he said, which may or may not be renewed.

It has all had a profound impact on his personal life. “We wanted to get married, buy a house and build a future,” said Mr. Özalp, who lives with his fiancée. “Now that’s all up in the air.”