Recently my local public television station has been showing a fascinating series entitled "Russia's War" - a history, produced in Russia, of the Soviet Union's struggle in World War II. It is not a pretty story: the producers do not hesitate to tell the full story of Stalin's brutality, and they do not try to mask the ugliness of war with patriotic romanticism. Yet this stark honesty in a way makes the account of the Soviet Union's wartime achievement all the more impressive. The Soviet Union did not win through military genius: most of its trained officers had been purged in political witch-hunts, and while the war eventually threw up a new set of leaders, they were competent rather than brilliant - and their advice was often overruled by a dictator whose military judgement was usually disastrous. Russian soldiers fought with dogged heroism - but then so did the Germans. Why did the Russians prevail?

The answer is surprising, given the way the 20th century has actually turned out. The Soviet triumph in World War II was, above all, a victory of production. Despite huge losses in the first months of the war, despite mass dislocations of population and the German occupation of many of the country's key manufacturing centers, Soviet industry managed to build tanks, artillery, and aircraft that were technologically a match for Germany's weapons, and to do so at a rate that consistently exceeded anything their opponents thought was possible. Indeed, the decisive German defeats at Stalingrad and Kursk came about precisely because the Germans launched offensives against what they imagined to be a weaker opponent, and were taken by surprise when counterattacked by thousands of tanks whose existence they had never suspected.

What does this have to do with the world of 1997? Well, nowadays we take the triumph of capitalism as something preordained by the superiority of our economic system. After all, it now seems obvious to everyone except North Korea and Cuba that a market economy is vastly more productive than one controlled from the center - and the Cuban economy is imploding, while the North Koreans are quite literally starving to death. Moreover, every time a Communist regime collapses, it turns out that the actual state of the economy it governed was far worse than anyone had imagined. For example, typical estimates of the GDP of East Germany before the old regime collapsed put its real GDP per capita at 70 or 80 percent of the West German level - meaning that East Germany was actually richer than some regions in the West. Yet after the fall of the Berlin Wall, visiting Westerners found something that looked like a Third World economy, with antiquated factories (and disastrous environmental problems) producing consumer goods of ludicrously low quality (like the notorious East German Trabant, an automobile that makes a Honda or Ford seem like a Mercedes). We used to think that the Soviet Union had an economy about half as large as America's, that is, bigger than Japan's; nowadays Russia seems to have less economic power than, say, Italy. We used to think that there was a real technological race between socialism and capitalism; nowadays the symbol of Russian technology is the hapless Mir space station. It seems obvious to many people in retrospect that the productive and technological triumphs that Communists used to claim - all those heroic photgraphs of dams and posters of muscular steelworkers - were mere propaganda; in reality, we think we have learned, socialism is a system that just can't deliver the goods, while capitalism is a system that can.

But one lesson of "Russia's War" is that matters are not that simple. Were the supposed productive triumphs of the Soviet Union under Stalin merely a hoax? Tell that to the soldiers of Germany's Army Group Center - the few who survived. The fact is that Stalin did transform Russia into a massive industrial power - a power tested in the most unambiguous way imaginable. And his successors did achieve real technological triumphs - not just showy triumphs like sending cosmonauts into orbit, but the creation of a highly sophisticated scientific and engineering establishment. True, Russia was never any good at producing high-quality consumer goods. But it was not always the bumbling, incompetent system we now imagine. What this means is that the collapse of Communism and the triumph of capitalism need more of an explanation than the stories we usually hear. It is not enough to explain all the reasons why a market economy is more efficient than a centrally planned one. Those explanations are basically right - but the question is why a system that functioned well enough to compete with capitalism in the 1940s and 50s fell apart in the 1980s. What went wrong?

One possible answer is that changing technology changed the rules. When the communist leader Joseph Dzhugashvili changed his name to Stalin - "man of steel" - he reflected the times in which he lived, an era in which heavy industry ruled, in which giant steel plants were the symbol of progress. These days, of course, steel-producing regions throughout the world - not just in the old Soviet Union - are depressed; try visiting southeastern Belgium.And it's not just steel: the age when countries or companies grew rich by making heavy products in big factories seems to have passed. One can make a case that whereas old-fashioned heavy industry was susceptible to central planning, new technologies, especially in microelectronics, favor free-wheeling competition over centralized control. Russia could at least appear to hold its own in a technological race defined by the ability to build giant rockets; it was left completely flatfooted when the West started putting powerful computers on a chip. In fact, in the last few years even Japan's great corporations have started to look a bit like dinosaurs, lumbering helplessly in pursuit of the little startups of Silicon Valley.

Another possible answer is that capitalism triumphed because of "globalization" - a process everyone talks about but which we really don't fully understand. For some reason - perhaps some synergistic interaction among declining tariffs, cheaper transportation, and better communications - it has become possible in the last generation for many countries to industrialize rapidly, not through massive programs of government-led investment, but simply by throwing themselves open to the world market and letting events take their course. Socialist economies could not avail themselves of this new opportunity, and so they began to fall beind instead of catching up.

But neither technological change nor globalization can explain the fact that socialist economies did not merely lag the West: they actually went into decline, and then collapse. Why couldn't they at least hold on to what they had?

I don't think anyone really knows the answer, but let me make a conjecture: the basic problem was not technical, but moral. Communism failed as an economic system because people stopped believing in it, not the other way around.

A market system, of course, works whether people believe in it or not. You may dislike capitalism, even feel that as a system it will eventually fail, yet do your job well because your family needs the money you earn. Capitalism can run, even flourish, in a society of selfish cynics. But a non-market economy cannot. The personal incentives for workers to do their jobs well, for managers to make good decisions, are simply too weak. In the later years of the Soviet Union, workers knew that they would be paid regardless of how hard they tried; managers knew that promotions would depend more on political connections than on performance; and nobody was offered rewards large enough to justify taking unpopular positions or any sort of serious risk. (There can't have been more than a few dozen people in the Soviet Union - all of them politicians - who had the kind of lavish life style enjoyed by tens of thousands of successful entrepreneurs and executives in the United States). So why did the system ever work? Because people believed in it. I don't mean that people went singing to their jobs, praising the motherland. I do mean that they did not take as much advantage of the system as they might have (and did, in the system's later years). And I also mean that because people in authority believed in the system, they were willing to impose brutal punishments on those who did try to take advantage. (Stalin used to shoot unsuccessful generals).

We see this kind of thing all the time, in microcosm. The market does not require people to believe in it; but the centrally planned economies that live inside a market economy, known as corporations, do. Everybody knows that financial incentives alone are not enough to make a company succeed; it must also build morale, a sense of mission, which makes people work at least somewhat for the good of the company rather than think only of what is good for them. Luckily, under capitalism an individual company can fail without taking the whole society down with it - or it can be reformed without a bloody revolution.

Why did people stop believing in socialism? Part of the answer is simply the passage of time: you can't expect revolutionary fervor to last for 70 years. But perhaps also the unexpected resurgence of capitalism played a role. By the 1980s Russia's elite was all too aware that the country, instead of overtaking the capitalist nations, was slipping behind - that Russia was failing to take advantage of new technology, that if anyone was challenging the West it was the rising nations of Asia. Communism lost any claim to the mandate of history well before it actually fell apart, and perhaps that is why it fell apart.

In the end, then, capitalism triumphed because it is a system that is robust to cynicism, that assumes that each man is out for himself. For much of the past century and a half men have dreamed of something better, of an economy that drew on man's better nature. But dreams, it turns out, can't keep a system going over the long term; selfishness can.