Why would voters in an economically successful country, where per capita economic output has been rapidly catching up to wealthier neighbors, want to oust their government? In Poland, where a populist opposition candidate has just beaten the incumbent in a presidential election, the answer seems to be that growth is not the indicator people care most about.

In conventional terms, Poland has been an exceptional European success story during the eight-year administration of Civic Platform, the party of outgoing president Bronislaw Komorowski. It grew faster than most European Union countries before the 2008 crisis -- and, uniquely, avoided recession afterwards, performing more like an emerging market than a large EU country. In 2008-2013, its gross domestic product per capita increased faster than Brazil's:

Source: McKinsey, IMF

In terms of GDP per capita at purchasing power parity, Poland is now at about 60 percent of the EU average. That's up from 32 percent 25 years ago; under Komorowski, the gap was closing as fast as ever. Yet the president lost a run-off vote to Andrzej Duda of the Law and Justice party on Sunday.

If one were inclined to treat politics as sports, one could attribute the upset to Duda's superior athletic skills. Komorowski squandered a huge early lead by being too passive and complacent. He woke up after losing in the first round two weeks ago, but it was too late. Duda ran an aggressive campaign, traveling widely and playing to Poles' nationalist sentiments. He promised, for example, to tax foreign banks and retail chains, and he was tougher than Komarowski on Russia, which helped him win in eastern Poland, close to the borders with Ukraine and Belarus.

The fundamental reason for his victory, however, is inequality. Jacek Zakowski, a veteran political journalist, described it on election day in a column in Poland's leading daily Gazeta Wyborcza:

The equality that is missing is not the Communist kind. I'm talking about an equal access to the minimum. The equality of basic rights and duties. Politicians are scared of equality because they believe it's bad for efficiency. So Poles go to Ireland, Germany, the U.K. not because there is more work in these countries but because a minimum of equality allows people to live there even if they are not part of the privileged class.

Economic inequality is part of it, of course. According to Eurostat, Poland has a Gini coefficient just above 30 percent, signifying a bigger gap in well-being than in, say, the Czech Republic or Slovakia, with Gini coefficients below 25. Still, Poland's level of inequality is close to the EU average and lower than, say, in Italy. It's perception that matters, and perception depends on things as esoteric as national character.

Poles are fiercely proud and sensitive to humiliation. In a 2010 paper titled "The emerging aversion to inequality," Irena Grosfeld and Claudia Senik wrote that after Poland broke abruptly with its Communist past, many viewed income inequality as a source of incentive. By 1996, however, even the more anti-Communist, economically liberal Poles were unhappy about it. High perceived inequality and the comparative lack of opportunity for the underprivileged began to weigh heavily on Poles' perception of their country as a nice place to live.

This year's World Happiness Report, published by a team of world-renowned economists under the aegis of the United Nations, puts Poland in 60th place globally in terms of happiness for the 2012-2014 period, below much poorer countries that haven't made the EU cut such as Moldova and Belarus. Most European countries placed higher. Poland was 51st for the 2010-2012 period, above the post-Soviet nations. If Komorowski had studied these reports, not just the economic growth numbers, he may have campaigned differently -- and with more success.

During his campaign, Duda talked of "rebuilding community." According to the World Happiness Report, a strong sense of community improves a country's position in the rankings. The election winner also made some expensive social pledges, promising to raise benefits for families and cut the retirement age, which the Civic Platform government raised to 67 from 65. That was a reflexive answer to what Zakowski called "the uprising of the precarious class" -- the millions of Poles working from one day to the next and struggling to see a future for themselves.

In reality, Duda cannot deliver on all of those promises, which depend on the legislature and on the cabinet, elected by parliament. The next parliamentary election will take place in October, and while the Law and Justice party will probably make gains, there is a strong chance that an even more populist force, headed by rock musician Pawel Kukiz who won 20 percent of the vote in the first round of the presidential election, will be represented. The voters' rebellion is not about social spending as such; it's about installing a government that will show its citizens more respect and give them a stronger sense of empowerment.

In that sense, the surprising result of the Polish presidential election is part of a wider European trend: By backing populist parties, voters are telling the political establishment across the continent to pay more attention to what makes people happy, not just to the economic numbers.

This column does not necessarily reflect the opinion of Bloomberg View's editorial board or Bloomberg LP, its owners and investors.