Now, the world's No. 1 producer of the edible oil is seeing a more than $2.5 billion wave of investment to build a refining industry that will double its capacity and mean it could supply the entire needs of Asia's top food consumers - India and China.

The transformation - driven by Indonesia's move to slash export duties for processed oil last October - will heat up competition with rivals such as Malaysia and send ripples through the palm oil market as new supply pressures prices of traded refined products such as palmolein, used as cooking oil.

A Reuters survey of 30 firms operating in Indonesia - from the world's biggest listed palm oil firm Wilmar to conglomerate Unilever - shows plans to nearly double refining capacity to 43 million metric tonnes (47.39 million tons) of palm oil, or 80 percent of total world output.

"The government is sending a clear message - to survive, you need a refinery. So the palm oil firms are putting their money out and following the big guys in the industry who have already done so," said Thomas Mielke, an analyst at industry publication Oil World.

"There is the threat of over capacity. But palm oil firms with the whole supply chain behind them, we are talking about having plantations to mills and ports, will be the kings."

Gleaming silver storage tanks standing ten-storeys' high are becoming a feature of Indonesia's landscape as more refineries spring up, threatening the stranglehold on processing held by neighboring Malaysia, the No.2 palm oil producer.

At a newly built refinery near Jakarta, staff wearing face masks and hair caps work on conveyor belts carrying boxes of margarine and cooking oil.

The $249-million Marunda plant run by PT SMART was launched before the tax change and Indonesia's top palm oil firm plans to spend a further $200 million on new refining capacity despite the infrastructure issues it faced building Marunda.

PT SMART will be one of the biggest investors in the sector along with Wilmar and unlisted Musim Mas, which plans to spend $860 million, according to the survey.

Government officials in Malaysia and Indonesia say these firms had aggressively lobbied Jakarta to cut duties on refined palm oil to half those levied on crude.

Much of the expansion is led by companies owned by powerful tycoons in Indonesia. SMART is controlled by the family of Eka Tjipta Widjaja, who created a palm oil empire from his humble start selling biscuits from a rickshaw.

Foreign firms are not far behind. Commodities trader Louis Dreyfus formed joint ventures with planters such as Singapore-listed Kencana Agri to build refineries in Indonesia.

Until now, Indonesia had focused on expanding plantations. Oil palms cover roughly 8.2 million hectares (20.3 million acres), an area about the size of the island of Ireland, and their cultivation is often blamed for rainforest destruction.

BRING DOWN PRICES

Palm oil, the world's most traded and consumed edible oil, is used mainly as an ingredient in food such as biscuits and ice cream, or as a biofuel.

For decades, refined palm olein enjoyed premiums of 5-10 percent over crude palm oil futures.

But with more Indonesian supplies coming on stream, more inefficient refining operations could get shut.

On the flip side, greater competition could cut final product costs to the benefit of consumers in India and China, where food inflation is a constant concern for policy makers. So far this year, palm olein prices have fallen nearly 10 percent on higher Indonesian supplies.

Under its refining plans, Indonesia could meet domestic needs of around 10 million metric tonnes annually as well as supplying the combined 20 million metric tonnes of edible oil imports required by top buyers China and India.

Indonesia's crude palm oil output - estimated at 23 to 25 million metric tonnes in 2012 - looks set to be outpaced by the planned increase in refining capacity in the next two years.

That means some palm oil firms may build refineries run at lower capacities until more edible oil supply comes in.

DBS analyst Ben Santoso said latecomers to Indonesia's refining business could see margins squeezed to $40 per tonne from $70, although still healthier than its main competitor.

"The capacity of some of these smaller companies will turn idle. But let's not forget, Malaysia's refining margin is just $9 to $10 a tonne," he added.

MALAYSIA AND INDIA FEEL THE PRESSURE

As Indonesia rushes to build refineries, vegetable oil refiners in Malaysia and India are feeling the pressure.

"I am having sleepless nights. I have closed down 30-40 percent of my factory and I hope it won't be more," said a refiner in Malaysia's Johor state.

Malaysia currently has 22.9 million metric tonnes of refining capacity, with only about three quarters of it used last year down from a record 90 percent in 2005.

And this shows in exports. Malaysia's combined refined palm olein exports in April and May dropped 19 percent to about 1 million metric tonnes from a year ago, according to cargo surveyors.

Indonesian palm olein shipments jumped 55 percent in the same period to nearly 600,000 metric tonnes.

Malaysia could respond by removing a tax free export quota for crude palm used to feed the overseas factories of some firms or replicate Indonesia's tax system to level the playing field.

Both options are politically risky with an election on the horizon, as they entail taxing crude palm oil that in Malaysia is mostly produced by small farmers who make up the bulk of the electorate and come under the tax free export quota.

To capitalize on Indonesia's export tax changes, Malaysia's top planter Sime Darby is building an Indonesian refinery. KL Kepong and IOI Corp are expected to follow suit.

India, the world's largest edible oil buyer, has been fending off industry calls to hike the import duty on refined palm oil to stem the inflow of cheap cargoes from Indonesia for fear of stoking inflation.

India currently imposes a 7.5 percent tax on refined palm oil from Indonesia. But it is still $15 cheaper a tonne to import Indonesia's processed palm oil than to ship in crude and refine it, traders say.

"Before Indonesia changed the export taxes, a lot of refiners were expanding their factories," said Ashok Sethia, President of the Solvent Extractors Association of India.

"Now all those plans have been abandoned," he added.

Refined palm olein used to make up below 5 percent of total imports and now accounts for nearly 20 percent of 883,410 metric tonnes shipped into India in May.

This will make it hard for India to preserve its processing capacity of 15 million metric tonnes.

SENSITIVE POLICY

Palm oil is just part of Indonesia's efforts to attract investment and squeeze more from its agricultural and mineral resources, a policy that has sometimes backfired.

In May, Indonesia imposed a 20 percent tax on some metal ore exports and told miners to submit plans to build smelters or process ore domestically. The government says this should help Indonesia earn more revenue, although a union said miners had laid off more than 200,000 workers since the ruling.

Taxes on palm oil were introduced in 1994 with the aim of ensuring palm-based cooking oil was available in the developing country of more than 200 million people.

But the system fell apart when the rupiah currency collapsed during the Asian financial crisis in the late 1990s, prompting palm oil firms to export more and triggering food riots at home.

With this in mind, export taxes on crude palm oil were kept much lower than on refined oil to shore up domestic supply. That frustrated the processing industry with many firms thinking of exiting Indonesia in 2010 and 2011, said Sahat Sinaga, executive director of the Indonesian Vegetable Oil Refiners Association.

"If the government did not take action, we would have just remained a crude palm oil exporter and earned much less," said Sinaga."

(Chew Yee Kiat reported for the story from SINGAPORE; Editing by Ed Davies)

By Michael Taylor and Niluksi Koswanage and Chew Yee Kiat