THE true extent of Africa's vast wealth of resources is hard to guess. Geologists have picked over most of the rest of the globe in search of minerals, yet huge swathes of Africa remain largely unprobed. But the immense ore deposits so far discovered and soaring commodity prices on the back of rip-roaring Chinese demand have convinced the world's miners that the continent is the next big frontier. Bumper profits have also spurred mineral-rich countries to seek a bigger share of the spoils.

The list of African governments that have miners in their sights is a long one. South Africa, home to the greatest mineral wealth in the world, estimated to be worth $2.5 trillion, is considering imposing a swingeing 50% windfall tax on mining “super profits” and a 50% capital-gains tax on the sale of prospecting rights. Those are among the proposals put forward by an independent panel of experts, set up by the ruling African National Congress (ANC) to study the possibility of greater state intervention in the mining sector.

Ghana, Africa's second-biggest gold producer, recently announced a review and possible renegotiation of all mining contracts to ensure that mining profits are “maximised…[for] the good of the country”. It plans to raise taxes on mining companies, from 25% to 35%, and a windfall tax of 10% on “super profits” in addition to existing royalties on output of 5%. Zambia, which is Africa's biggest copper producer, recently doubled its royalties on the metal, to 6%. Guinea, home to the world's largest bauxite reserves as well as one of the world's biggest iron-ore deposits, is helping itself to a 15% stake in all mining projects and an option to buy a further 20%. Namibia has decided to transfer all new mining and exploration to a state-owned company.

If miners in these countries feel hard-done by, they should count themselves lucky that they are not wielding their shovels in Zimbabwe. Its “indigenisation” policy will force foreign firms to “cede” a 51% stake to locals. Nigeria may renegotiate offshore oil contracts, because today's “unfair fiscal terms” are costing the country $5 billion in lost revenue, it claims. And so it goes on. Right across the continent governments are seeking new ways to squeeze more out of foreign-owned firms growing rich off what lies beneath Africa's soil.

Resource nationalism is nothing new. Big Oil has suffered periodic bouts of nationalisation and sometimes seen contracts torn up in the Middle East and beyond that had run for more than 50 years. Nor is the practice confined to developing countries that feel they came off second-best when negotiating resource deals in years gone by. Australia is set to raise some $8 billion a year through a controversial new tax on miners; Britain has previously dipped into the profits of oil companies in the North Sea.

However, in the past year resource nationalism has jumped to the top of the list of things that worry the 30 biggest global miners. This was prompted by 25 countries worldwide announcing plans to boost their take of profits, according to a survey by Ernst & Young, a consultancy. A rapid rebound after commodity prices collapsed in the aftermath of the financial crisis in 2009 convinced cash-strapped governments that large multinationals were easy targets. In Africa mining companies are often especially vulnerable—they are usually the biggest corporate beasts around. Widespread poverty has provided a ready excuse for governments dependent on income from resources. The trick for miners is to ensure not only that the money keeps flowing but also that the miners agree to the spending on roads, railways, schools and hospitals that are now a customary part of the package the industry offers to acquire mineral rights.

Many feel abused but they do not have much choice. In a world where big new ore bodies are hard to find, most will keep coming back to Africa. Of the ten biggest mining deals to be completed last year, seven were in Africa, according to Ernst & Young. Even as governments move to grab bigger slices of the cake, high prices mean the miners remain profitable. Anglo American, a mining giant, has earmarked $8 billion for new platinum, diamond, iron ore and coal projects; Brazil's Vale said in June that it plans to spend more than $12 billion over the next five years. Rio Tinto, which has not had an easy time with its mammoth African investment at Simandou in Guinea, also signalled it will stick with Africa.

Many of the resources are spread across the continent fairly evenly, leaving miners with a choice about where to go. Given that mining investments can cost many billions of dollars and take up to a decade to show a profit, miners are understandably wary of working in countries where the fiscal rules change unpredictably.

Zimbabwe's new law requiring indigenisation, apparently without compensation, is clearly not designed to attract new foreign investment. The three biggest miners already operating there—Zimplats, Rio Tinto and Anglo Platinum—also face a doubling of royalties on platinum to 10%, along with a ban on raw platinum exports, that will oblige them to build a refinery in Zimbabwe at a cost of some $2 billion.

Regardless of Zimbabwe's heavy-handed treatment, mining companies do not necessarily object in principle to giving locals a larger stake in their operations. After the end of apartheid in South Africa, white mining bosses were at the forefront of drafting the country's black-economic-empowerment laws. These require mining firms to sell stakes of at least 26% to black shareholders by 2014.

The ANC-commissioned panel recommends that this be increased to 30%. The Chamber of Mines recently announced that on average its 33 members, representing three-quarters of the industry, had already achieved today's target. Nonetheless, the government puts the black share at just 9%, as most black-owned shares were bought with borrowed money. This could mean trouble.

Investors have been even more worried by the persistent demands of the ruling ANC's powerful Youth League for nationalisation, with or without compensation. The ANC's expert panel has come out strongly against the idea on the grounds that the official purchase of listed mining companies' shares, at an estimated cost of 1 trillion rand ($130 billion), is far beyond the government's means and implementing a Zimbabwe-style asset grab would be unconstitutional and counter-productive.

Most ministers are privately opposed to nationalisation. Many lived in exile in Zambia in the 1970s and 1980s when President Kenneth Kaunda nationalised the country's copper mines—with disastrous effect. South Africa's president, Jacob Zuma, continues to insist that nationalisation “is not government policy”. But investors remain nervous.

Ernst & Young recently suggested that southern African countries such as Botswana, Mozambique and Namibia were becoming increasingly attractive mining destinations at the expense of South Africa, which has slipped 18 places since 2008, to 67th out of 79 countries in the annual survey of mining-investment attractiveness compiled by the Frazer Institute, a Canadian think tank.

Miners and governments often look enviously at Debswana, the successful 50-50 diamond joint venture between Botswana and De Beers, the world's leading diamond firm. Set up over 30 years ago, it accounts for nearly a third of Botswana's GDP, half of government revenues and around three-quarters of export earnings. Even though 80% of the profits go directly into government coffers, De Beers considers Debswana one of its best investments. So why is the model not being adopted everywhere?

Because, says James Suzman, public affairs director at De Beers, Botswana is unique. It has rich and productive mines, a stable and trustworthy government with one of Africa's best records of good governance and it is a small country of 2m people where the impact on ordinary folk is huge, so everyone feels they are benefiting. In Namibia, where De Beers also operates, the cash-strapped government seems reluctant to carry its share of the investment burden. And even Botswana is not above a bit of resource nationalism.

Sorted

Last year De Beers was obliged to move its London-based sorting operation to the country—and all the jobs and other economic benefits that go with it—in return for extending the renegotiating period for its diamond-sales agreement from five years to ten. Meanwhile Namdeb, a similar joint venture between De Beers and Namibia, has run into a trouble. Without new investment of around $1 billion, Namdeb says, its mines will have to close in the next couple of years. With it, they could probably be successfully exploited for another five decades.

Populist advocates of greater state participation in mining often forget that nationalisation, partial or complete, means that when the going gets tough, as it eventually will in a cyclical industry like mining, the state must be prepared to cough up, like any other shareholder, to keep the business afloat.

It is much easier for states to impose royalties on production volumes. These can be reaped whether or not the company is profitable. The art is in striking the right balance. African governments must not wring so much out of their resources today that the mining companies fail to invest for the future.