As Venezuelans get ready to head to the polls for the most closely fought presidential election of the past 14 years, one question is at the forefront of everyone's mind: does Hugo Chávez still have it? By "it", I mean his legendary, intense, emotional connection with the poor – a kind of attachment that has, for many, a feeling of religious fervour. Of faith.

"Chávez is the only one who has ever really cared about the poor" – you hear his supporters say it again and again, with real feeling, and now more than ever it's the centre of his pitch to voters.

Chávez: Heart of my Fatherland – the slogan turns up everywhere, right down to the water bottles given away to keep his supporters hydrated at rallies.

But 14 years on, as even his most hardcore supporters acknowledge, Chávez's experiment in 21st-century socialism isn't really working. After the chaotic nationalisation of most of the agro-industrial chain – from the farm to the supermarket – food shortages have become chronic, with various staples disappearing from shelves. Lines at subsidised government grocery shops are long, and particularly scarce commodities sell out almost the second they're delivered.

On closer inspection, the only thing that appears to be 21st century about Chávez's 21st-century socialism is the presidential Twitter account. The economy is still run along the same rigid lines that crippled eastern bloc economies for much of the 20th century. One after another, industries have been nationalised only to become outsized money-pits unable to produce the goods needed. The steel and cement industries can't produce enough to meet the country's housing needs; electric utilities have brought chronic blackouts throughout the country; and the phone company has failed to deliver adequate internet access. Venezuelans like to joke that Julian Assange passed over Venezuela for political asylum simply because the internet is so slow there.

That Venezuela's economy doesn't grind to a halt, Zimbabwe style, amid the waste, corruption and mismanagement of incompetent central planning is down to a single word: oil. Sitting atop the world's largest reserves at a time of extraordinarily high prices, the government is kept afloat by a torrent of petrodollars that more or less papers over the cracks. When steel production falls by two-thirds after a botched nationalisation, the government simply re-routes part of the petrodollar stream to finance steel imports. When nationalised farms suffer a similar fate, food imports are jacked up.

Oil wealth is a magical elixir that keeps up the appearance of normality, even as the country sinks deeper and deeper into the economic morass.

In many ways that near-mystical bond with the poor is the most important of the assets that oil funds. Chávez has been careful to keep the spigots open, channelling a constant stream of populist giveaways to his supporters. An oil-for-appliances deal with China, for example, has allowed Venezuela to import more than 3m Chinese-made stoves, refrigerators, washing machines, air conditioners and flat-screen TVs, goodies handed out directly to governing party supporters as part of "My Well-Stocked Home" – a government social programme, whose logo includes the comandante presidente's face. The guiding principle to Chavista social policy is simple: people must never be under the impression it's to the welfare state they owe their access to oil-financed goodies – all gratitude and loyalty must be focused on Chávez himself. The resulting cult of personality is neatly captured in that slogan. Chávez, we're told, is no mere politician: he is the "heart of my fatherland" – with that possessive pronoun to cement each voter's twin loyalties to the nation and its leader. It's only the tiniest step from that formulation to its flip-side: failure to support the leader is tantamount to treason.

It has taken Venezuela's long-suffering opposition movement 14 years to decode Chávez's intoxicating appeal and formulate a compelling alternative. This year the opposition has finally united and rallied around Henrique Capriles, an energetic young state governor who has put pragmatism and problem solving at the centre of his campaign. Capriles can't match Chávez for charisma, and doesn't try to. But after 14 years of deepening economic dysfunction, administrative chaos and dependence on oil, he has sensed an opening for a no-nonsense campaign centred on institutionalising the revolution's social advances while sweeping away its legacy of political sectarianism, ideological rigidity and mismanagement. "Never again should you have to show a Socialist party membership card to access a social programme," Capriles says in his stump speech, invariably bringing the house down. The line hits home because every person in the audience knows someone who has been shut out of access to the latest oil bonanza for ideological deviance.

Capriles senses there's a thirst in Venezuela to move beyond the divisive politics of the Chávez personality cult; that for more and more one-time Chavistas the old visceral pull of the caudillo's charisma has worn thin in the face of a mass of unsolved problems; that Venezuelans crave the type of minimally competent government they've not had for years; and that they're ready to take a chance on change.