The biggest general election of 2010 takes place on Sunday when Brazil, the world’s fifth-largest country, elects its new president, congress, governors and state legislatures.

As in most of Latin America, Brazil’s constitution is loosely based on that of the US: complete separation between the executive and legislative branches, fixed-term elections, a Senate with equal state representation and a president limited to two four-year terms. But Brazil’s actual history has mostly consisted of short periods of civilian rule, separated by military coups and dictatorship.

Since the return to democracy in the mid-1980s, however, Brazil has started to realise some of its immense potential. Centre-right president Fernando Cardoso, elected in 1994 and again in 1998, is widely credited with having put Brazil’s economy on a sound footing, but his party was defeated in 2002 by his left-wing rival, Luís Inácio Lula da Silva, who was re-elected in 2006.

Lula (as he is universally known) has become one of the most successful leaders in the democratic world, taking Brazil to unprecedented levels of growth and influence. Although he comes from the working class and has a history of left-wing populism, Lula has governed very much from the centre, working closely with the country’s business leaders to promote economic growth. At the same time, large-scale welfare programs are seen to have dramatically improved the lives of Brazil’s poor, with whom Lula remains enormously popular.

It’s not disputed that Lula would easily win re-election if he were permitted to run for a third term, and there is not much doubt that the next president will be his chief-of-staff and chosen successor, Dilma Rousseff. The main doubt is whether or not she will win a majority in the first round; if she fails to reach 50% on Sunday, there will be a run-off election four weeks later, on 31 October, presumably against the centre-right’s José Serra, currently governor of São Paulo state.

Lula’s regime has not been immune from scandals and he certainly has his critics, but overall his presidency has been a remarkable success story, retaining the support of the masses without lapsing into the authoritarianism that has characterised other leftist leaders such as Venezuela’s Hugo Chavez. He seems to have accepted that helping the poor requires sound finances and pro-growth policies, not just good intentions.

If Brazil can continue to build on Lula’s achievements, there is no reason it cannot become a major world power (as might Australia, with most of the same natural advantages, if only we had 190 million people). Together with increased growth and stability in Chile and Argentina, the ingredients are there for a major South American renaissance.

Most importantly of all, Brazil seems to have reached the point where political debate, while often heated, takes place against a background of shared assumptions: power can shift peacefully from one side to the other, as it did in 2002, without threatening the fundamentals of the system.

That political consensus, much more than formal institutions, is what makes democracy work, and its absence has bedeviled most of Latin America until recent times. But when it does work, as Lula’s record shows, democracy can make a big difference.