Capitalism has been the most dynamic force for economic progress in history. Over the past century, it has delivered billions of people out of miserable poverty, raised living standards to once-unimaginable heights, and enabled an unprecedented flourishing of productive creativity. But among young Americans, it finds itself on trial.

The University of Chicago's GenForward Survey of Americans ages 18 to 34 finds that 62 percent think "we need a strong government to handle today's complex economic problems," with just 35 percent saying "the free market can handle these problems without government being involved."

Overall, 49 percent in this group hold a favorable opinion of capitalism—and 45 percent have a positive view of socialism. Socialism gets higher marks than capitalism from Hispanics, Asian-Americans, and African-Americans. Sixty-one percent of Democrats take a positive view of socialism—and so do 25 percent of Republicans.

Contrast the millennials' opinions with those of their parents. A survey last year found that only 26 percent of baby boomers would prefer to live in a socialist country. Among young people, the figure was 44 percent.

What explains this generational divergence? The first factor is that young adults may take for granted the bounty capitalism has bestowed, from cellphones to inexpensive air travel to an endless array of food and beverage options. They can't remember the time when those things didn't exist.

But they will never forget the pain and uncertainty caused by the brutal recession of 2007-09, which has taken years to overcome. Financial catastrophe is bound to foster disenchantment with the economic order.

The Great Depression of the 1930s gave rise to a far more powerful and intrusive federal government—and caused some people to embrace communism. This found an echo in the Great Recession, as a lot of young people reached adulthood in a dismal job market. Their earnings and advancement suffered—and the effects persist.

Many of them associate capitalism with crisis, not progress. That may change as the economy continues expanding. But some of capitalism's more dogmatic advocates have done it lasting harm.

For eight years, as the economy steadily improved, many Republicans denounced President Barack Obama as a socialist out to demolish the free market. Obama left office with a 77 percent approval rating among millennials. If he was a socialist, many of them must have decided, socialism can't be so bad.

Without that experience, Bernie Sanders could not have come so close to getting the Democratic nomination in 2016. The socialist label lost much of its stigma from being cynically overused by the right.

The demise of Marxism in so many countries has actually been a boon to the left. Socialism was once seen as the path to communism. But with the Soviet Union dead and China only pretending to be socialist, those fears have faded.

It doesn't help the reputation of capitalism that many of those fervently opposed to government interference and redistribution are strongly at odds with millennials on social issues—including gay rights, racial inequality, immigration, gun control, and abortion rights.

The refusal of most conservatives to recognize the human role in global warming alienates those who will have to live with the environmental damage their elders did. In many minds, free markets have been discredited by their association with intolerance, rejection of science, and disregard for the poor.

For baby boomers, the champion of capitalism was Ronald Reagan. For millennials, it's Donald Trump. Among those who are 15 to 34, a recent poll found, two-thirds disapprove of his performance as president—and most regard him as "dishonest," "racist," and "mentally unfit."

What millennials may not realize is that many of the distinctive burdens they face are caused at least as much by government involvement as by free markets. Federal loans and grants have pushed up college tuition. Medicare inflates demand for health care. High housing costs in New York and San Francisco owe a lot to rent control and land-use restrictions.

When markets are allowed to work, they continue to generate innovations that expand options and reduce costs. Amazon, Apple, Uber, Starbucks, and Walmart have made life better for consumers. Food and clothing take less of our disposable income than ever before. Cars, TVs, and appliances are better and more reliable than they used to be.

In the end, though, economic systems have to retain their moral and political legitimacy if they are to last. Capitalism has always had to overcome its critics. But today, it may suffer more from its friends.