Now, Sweden doesn't always come in first, but it always does well by just about any important yardstick of social and economic success. In the latest available reports, Sweden placed fifth in the Legatum Institute's Prosperity Index, eighth in the World Bank's Doing Business report, and third in Transparency International's Corruption Perception Index. What makes Sweden perform better by so many criteria? Could other countries find lessons in Sweden's experience that apply across borders?

The good news is that combining research on the causes of prosperity with detailed studies of Sweden's economic and political history offers a fairly convincing answer to the first question. But knowing more about how Sweden became prosperous does not necessarily tell us whether the magic could be bottled for export. In fact, surprising as it may seem to those who see Sweden as the triumph of the modern welfare state, Sweden's success has largely been the result of trial and error, not to mention the beneficiary of the unintended consequences of public policy.

Yes, there are a few lessons to be learned by studying Sweden, just as there are things to be learned from the experiences of any other country. But the lessons from Sweden are not always what one might expect, and in some cases are truly elusive.

In the aftermath of the 2008 global financial crisis, Sweden was described as a rock star of recovery by The Washington Post and a supermodel for other crisis countries by The Economist. But before we scrutinize the Swedish model for insights into economic-crisis management, two things are worth noting.

First, just 25 years ago, things looked very different. Sweden was not a success story but rather the poster child for how not to run an open economy. Indeed, in October 1993, The Economist published an article with the headline "Worse and Worse," lamenting Sweden's humungous budget deficit (13 percent of GDP) and an increasingly unsupportable public debt, along with a rapidly depreciating currency.

Second, it bears emphasizing that, over the years, the example of Sweden has been used to support widely varying ideological positions. Around 1970, Sweden was the fourth- richest country in the world (in terms of per capita income), after Switzerland, the United States and Luxemburg. Social Democrats had been in power since the early 1930s and Sweden was widely touted as proof that socialism – at least the democratic, Swedish version – could work very well. The country had experienced 100 years of remarkably high growth and rising living standards, as well as narrowing gender inequality.

The economic problems that became apparent during the 1970s were initially blamed on factors beyond the little country's control, such as the oil price shocks. A center-right government did take office in 1976, with Social Democrats in opposition for the first time in 44 years. Its mandate, however, was not to push the Swedish economy in a new direction but to deliver what the Social Democrats had been supplying for decades until they slipped – namely, a globally competitive economy and ongoing social reforms.

It did make good on the latter, but failed with the former. It took repeated devaluations of the Swedish currency, the krona, to keep the economy – by necessity of its size and location, a very open economy – competitive. When the Social Democrats returned to power in 1982, yet another devaluation, combined with the global economic recovery of the 1980s, left the general impression that social democracy was back on track. But the fundamental problem of lagging competitiveness had not been solved, and the economic downturn of the early 1990s hit Sweden much harder than other countries.

By now, the debate regarding the Swedish model had shifted. Chronic economic problems (especially slow productivity growth) were now seen as proof that socialism didn't work – not even in Sweden. A new center-right government was elected in 1991, and this time the mandate was to make fundamental changes in the Swedish model, rather than to polish the one that Sweden had long embraced. In some areas the government succeeded; in others it hit a wall of resistance. Simply put, competition and economic freedom increased in many areas of the Swedish economy. But key areas, notably the labor market and the housing market, remained highly regulated.

The winding road Sweden has taken has made it difficult to say whether being more like Sweden involves increasing taxes and government intervention in the economy – or whether it means liberalization, deregulation and welfare-state retrenchment. So, before other countries try too hard to become more like Sweden, it is wise to look back at how Sweden came to be Sweden. The answers may surprise you – they certainly surprise a lot of Swedes.