Indonesia, which ships about a third of the world’s edible oil cargoes, has just imposed a sweeping ban on palm oil exports to protect its domestic market at a time of rampant global inflation—one of the most dramatic examples of food protectionism in recent history.

Vegetable oils, used in everything from cooking to candy, lipstick and fuel, have been on a tear after Russia’s invasion of Ukraine stymied exports of sunflower oil, worsening an existing shortage of oils caused by drought and labor woes. The dearth of supply sent demand soaring for Indonesian palm oil—the world’s most consumed edible oil—prompting the halt in sales.

But there’s a conundrum. Why did a country that only consumes just over a third of its production domestically have to resort to a complete export ban to meet its needs. The answer probably lies in the chaotic and fragmented nature of the local industry in a country that consists of more than 17,000 islands.

The distribution line from producers to retailers is messy, according to Sahat Sinaga, executive director of Indonesian Vegetable Oil Industry Association.

“There are lots of unregistered businesses in the supply chain, and some even don’t have tax identification numbers,” Sinaga said. The country has about 75 cooking oil processing plants, with only 37 of them being members of his association, and six in other industry groups, he said. The rest are unknown.

Indonesia produces more than 45 million tons of palm oil a year, with domestic consumption of about 16.5 million tons, according to the U.S. Department of Agriculture. The country’s trade ministry estimates use of palm for cooking at 5 million tons, which should not on the face of it be a difficult target to meet.

Still, in general terms, much of the cooking oil industry is geared up for exports and not structured efficiently to handle local consumption. Many plants are located in bonded zones in Java and Kalimantan, and lack links to the domestic market and distribution chains, Sinaga said. The segment of the industry oriented to the local market is scattered over Java and Sumatra, while 50% of the country’s consumption is in Java and Bali, he said.

Policy Failures

The government has struggled to control prices and secure local supplies since December, with a raft of measures ranging from price caps, to export curbs and cash handouts for households and hawkers. But all that failed to pull down prices to the government target of 14,000 rupiah (97 U.S. cents) per liter of bulk oil. The surging costs helped push inflation to a two-year high in March.

Distribution problems, and misuse of subsidized bulk oil, which was repackaged and sold as premium goods as well as being sold to the food industry, caused scarcity of supply and higher prices, Sinaga said. The price cap created a “black market” with prices almost double the government target, he said.

With prices still above 17,000 rupiah a liter this month, the government has resorted to a wide-ranging export ban on everything from crude palm oil to refined, bleached and deodorized palm olein and used cooking oil. Sinaga said Thursday he expects the ban to be lifted in May, but that remains to be seen.

President Joko Widodo has urged the industry to prioritize domestic supply as he sought to explain why such drastic action was being taken. “As the world’s biggest palm oil producer, it is ironic that we are having difficulty in getting cooking oil” for ourselves, said Jokowi, as the president is also known.