As the collapse of the Soviet Union approached, Francis Fukuyama proclaimed the victory of liberal democracy over planned socialism in his 1989 essay, “The End of History?” More than a quarter century later, the USSR has indeed disintegrated. Its former east European empire lies inside the European Union. China has a market economy, though the nation is led by a single party. And the “socialist” states of North Korea, Cuba, and Venezuela are in economic ruin. Few now advocate “back to the USSR.” At the same time, many people still consider socialism an appealing economic system. Consider, for example, that Bernie Sanders—an avowed supporter of a socialist United States—is America’s most popular politician—and that as many millennials favor socialism as capitalism.

The analogy of the jockey and the horse explains the continued appeal of socialism. Socialists believe that socialist regimes have chosen the wrong jockeys to ride the socialist horse to its deserved victory. Bad jockeys such as Stalin, Mao, Fidel, Pol Pot, and Hugo Chavez chose tactics and policies that led their socialist horse astray. But actually, a look at how the Soviet Union actually worked reveals that it’s the horse itself that’s the problem.

After gaining power a century ago and then holding onto it through a civil war, the Soviet communists were intent on building a socialist state that would overwhelm capitalism. State ownership and scientific planning would replace the anarchy of the market. Material benefits would accrue to the working class. An equitable economy would supplant capitalist exploitation and a new socialist man would rise, prioritizing social above private interests. A dictatorship of the proletariat would guarantee the interests of the working class. Instead of extracting surpluses from workers, the socialist state would take tribute from capitalists to finance the building of socialism.

The basics of the Soviet “horse” were in place by the early 1930s. Under this system, Stalin and his Politburo set general priorities for industrial ministries and a state planning commission. The ministers and planners worked in tandem to draw up economic plans. Managers of the hundreds of thousands of plants, factories, food stores, and even farms were obligated by law to fulfill the plans handed down by their superiors.

The Soviets launched their planned socialist economy as the capitalist world sank into depression, trade wars, and hyperinflation. Soviet authorities bragged of unprecedented rates of growth. New industrial complexes grew from scratch. Magazines featured contented workers lounging in comfortable resorts. The message: The West was failing, and the Soviet economic system was the way to the future.

As the competition between capitalism and Soviet socialism became more pronounced during the Cold War, serious scholarly study of the Soviet economy began. The overarching research agenda of Western scholars was “scientific planning”—the socialist belief that expert technocrats could manage an economy better than spontaneous market forces. After all, would not experts know better than buyers and sellers what, how, and for whom to produce?

It was the Austrian economists F. A. Hayek and Ludwig von Mises who resisted this idea most forcefully. In their landmark critique laid out in a series of papers written from the 1920s through the 1940s, they concluded that socialism must fail. In modern economies, hundreds of thousands of enterprises produce millions of products. Even with the most sophisticated computer technology, managing such large numbers would be far too complex for an administrative body trying to allocate resources. Modern economies, therefore, are too complex to plan. Without markets and prices, decision-makers will not know what is scarce and what is abundant. If property belongs to all, what rules should those who manage assets for society follow?

The Soviets’ solution to the complexity and information problems was a national plan that spelled out production goals only for broad sectors, not for specific transactions. In other words, rather than mandate the delivery of 10 tons of steel cable by factory A to factory B, the planners set a target for the total number of tons of cable to be produced nationwide. Only a few specific goods—such as crude oil, aluminum ore, brown coal, electricity, and freight-car dispatches—could be planned as actual transactions. Everything else had to be planned in crude quantities, such as several million square meters of textile products. Product specifications, delivery plans, and payments were worked out at lower levels and often with disastrous results.

Soviet scientific planning, in fact, directed only a minuscule portion of products. In the early 1950s, central agencies drew up less than 10,000 planned indexes, while industrial products numbered more than 20 million. Central agencies drew up generalized plans for industrial ministries, which issued more detailed plans to “main administrations,” which prepared plans for enterprises. There never was a pretense that the top officials would plan the production of specific products.

To make matters even more complicated, virtually all plans were “drafts” that could be changed at any time by higher state and party officials. This constant intervention, called “petty tutelage,” was an irritant from the first to the last day of the Soviet system, but it was a key pillar of resource allocation.

Central planners prepared preliminary plans for a small percentage of the economy. These “draft plans” set off huge “battles for the plan” as ministries and enterprises scrambled to fulfill their production targets and meet their delivery quotas, all of which could be changed by party and local officials at any time.

As the commissar of heavy industry, Sergo Ordzhonokidze complained in 1930: “I guess they think we are idiots. They give us every day decree after decree, each one without foundation.” An unnamed defense contractor echoed the same complaint a half century later: “They stick their heads into every single issue. We told them they were wrong, but they would demand that things be done their way.”

The manager’s task was presumably simple: The plan was the law; the manager’s job was to fulfill the plan. But the plan kept on changing. Moreover, it consisted of multiple tasks, such as deliveries, outputs, and an assortment program. Throughout the entire history of the Soviet Union, gross output (measured in tons, meters, or freight/miles) was the most important plan indicator and the most malleable. Nail producers, whose output was judged by weight, would produce only heavy nails. Tractor manufacturers, struggling to meet their tractor quota, were caught delivering tractors without engines to their customers, who accepted them anyway for their spare parts. Shoe manufacturers, whose plans were based on quantity, produced one size and one color to the chagrin of customers. Other targets, such as cost reductions or new technologies, were ignored as counting less towards fulfillment of the plan.

Under scientific planning, supply had to roughly equal demand—and, given their distaste for the anarchy of markets, Soviet planners could not balance supply and demand by raising and lowering prices. Instead, they compiled “material balances” using primitive accounting to compare what materials were on hand with what were, in some sense, needed.

Soviet material-balance planning suffered from a number of deficiencies. For example, only a few balances could be compiled—in 1938, only 379 central balances were prepared in a market of millions of goods. And then, the balances were based on distorted information. Producers of goods in the balance lobbied for easy targets that concealed their capacity. Industrial users in the balance overstated what they needed to be sure of fulfilling their own plans.

Figuring out the proper balance was an exhausting exercise—and Soviet planners did not reinvent the wheel each year. Instead, they resorted to what came to be known as “planning from the achieved level,” which meant that each year’s plan was last year’s plus some minor adjustments.

By the early 1930s, supply agencies were distributing materials based on what they did in the previous year. A fast forward to the 1980s reveals the same practice in place: When a producer of welded materials wished to use thinner metals, the official answer was: “I don’t care about new technology. Just do it so that everything remains the same.” Material-balance planning was hostile to new products and new technologies because they required a reworking of an already fragile system of balances. American economists who were studying Soviet industrial production in the 1950s were astonished that the same machines were produced over decades without modification, something unheard of in the West.

Material-balance planning was the most fundamental weakness of the Soviet system. It froze the Soviet economy in place. Each year’s production was a replica of the previous year. A Soviet manager from 1985 would have felt quite at home in the same enterprise in 1935.

Beyond material-balance planning, soft budgets constituted another key defect. The economist Janos Kornai of Harvard University grew up in Hungary under planned socialism. His research, which draws on his first-hand experiences, focuses on the economic losses associated with soft budget constraints. As Kornai, if enterprises do not face the risk of bankruptcy, they will not seek out cost economies and other survival strategies. From day one of the Soviet system, loss-making enterprises understood they would be bailed out automatically, if not right away.

The primary cause of soft budgets was that the Soviet system was based on output plans. One enterprise’s output was another’s input. If output plans failed widely, the whole plan would fail. Taking an enterprise out of production due to insolvency was simply not an option.

In practice, loss-making enterprises paid for deliveries with IOUs. Unsettled IOUs would grow until they reached crisis proportions. Gosbank, the state bank, would then step in and make good on the unpaid bills by issuing money and creating what Soviet banking officials called a monetary overhang—more rubles chasing goods than there were goods to buy. In fact, Gosbank’s main business in the early years of the Soviet Union was organizing bailouts. When one was completed, it was time to start working on the next.

The problem with socialism isn’t a bad jockey—it’s the horse itself. The Soviet economic system suffered from pathologies that would ultimately doom it. Starting in the late 1960s, the USSR economy went into a long decline, which came to be called the “period of stagnation.” Mikhail Gorbachev was elected General Secretary of the Communist Party in 1985 on the pledge that he, as a radical reformer, would reverse the decline.

Gorbachev failed because the core of the Soviet planned system was rotten Despite his reform inclinations, he remained a believer in socialism. He was determined to save Soviet socialism by making it more like capitalism. In so doing, he created an economy that was neither planned nor a market—a chaotic free-for-all, which the Russian people regrettably associate to this day with that they came to call “wild capitalism.”