NOT long ago Malawi was a donor darling. Being dirt poor and ravaged by AIDS, it was needy; with just 17m inhabitants, a dollop of aid might visibly improve it. Better still, it was more-or-less democratic and its leader, Joyce Banda, was welcome at Westminster and the White House. In 2012 Western countries showered $1.17 billion on it, and foreign aid accounted for 28% of gross national income.

The following year corrupt officials, businessmen and politicians pinched at least $30m from the Malawian treasury. A bureaucrat investigating the thefts was shot three times (he survived, somehow). Germany said it would help pay for an investigation; later, burglars raided the home of a German official and stole documents relating to the scandal. Malawi is no longer a donor darling. It now resembles a clingy lover, which would be dumped were it not so needy. It still gets a lot of foreign aid ($930m in 2014), but donors try to keep the cash out of the government’s hands.

Foreign aid can work wonders. It set South Korea and Taiwan on the path to riches, helped extinguish smallpox in the 1970s and has almost eliminated polio. Unfortunately, as Malawi shows, it is liable to be snaffled by crooks. Aid can also burden weak bureaucracies, distort markets, prop up dictators and help prolong civil wars. Taxpayers in rich countries dislike their cash being spent on Mercedes-Benzes. So donors strive to send the right sort of aid to the places where it will do the most good. How are they doing?

A decade ago governments rich and poor set out to define good aid. They declared that aid should be for improving the lot of poor people—and not, implicitly, for propping up friendly dictators or winning business for exporters. It should be co-ordinated; otherwise, says William Easterly of New York University, “the poor health minister is dealing with dozens of different donors and dozens of different forms to fill out.” It should be transparent. Where possible, it should flow through governments.

These are high-minded ideals, reflecting the time they were laid down: the cold war was over and the West had plenty of money. They are nonetheless sound. Aid-watchers, who row bitterly over whether the world needs more foreign aid or less, mostly agree with them. They tend to add that aid should go to relatively free, well-governed countries.

By almost all of these measures, foreign aid is failing. It is as co-ordinated as a demolition derby. Much goes neither to poor people nor to well-run countries, and on some measures the targeting is getting worse. Donors try to reward decent regimes and punish bad ones, but their efforts are undermined by other countries and by their own impatience. It is extraordinary that so many clever, well-intentioned people have made such a mess.

Official development aid, which includes grants, loans, technical advice and debt forgiveness, is worth about $130 billion a year. The channels originating in Berlin, London, Paris, Tokyo and Washington are deep and fast-flowing; others are rivulets, though the Nordic countries are generous for their size. More than two-fifths flows through multilateral outfits such as the World Bank, the UN and the Global Fund. Last year 9% was spent on refugees in donor countries, reflecting the surge of migrants to Europe.

As the aid river twists and braids, it inundates some places and not others. India contains some 275m people living on less than $1.90 a day. It got $4.8 billion in “country programmable aid” (the most routine kind) in 2014, which is $17 per poor person. Vietnam also got $4.8 billion; but, because it is much smaller and rather better off, that works out to $1,658 per poor person (see map). By this measure South-East Asia and South America fare especially well.

Western countries have mostly been shamed out of the cold war-era habit of funnelling aid to friendly regimes and former colonies. But aid is still used more-or-less explicitly as a tool of foreign policy—and increasingly so, says Owen Barder of the Centre for Global Development, a think-tank. Today’s enemy is not communism but radical Islam. Afghanistan, Egypt, Jordan, Syria and Turkey each got more net aid than Bangladesh in 2014, although none contains nearly as many poor people. This week the EU promised more aid to African and Middle Eastern countries that clamp down on migrants.

Rewarding failure

A better reason not to give much aid to the poorest countries is that many are badly run. But that is not why they get so little. Claudia Williamson of Mississippi State University has created a yardstick that measures both poverty and the quality of government. On her measure, the targeting of aid worsened between 2004 and 2012. “Aid goes to middle-income countries that are also poorly governed,” she says.

Donors often reward democratic reforms; they also try to punish corruption and backsliding, as in Malawi. Between 2009 and 2014, 12 countries improved by at least two points on a 14-point scale produced by Freedom House, a think-tank, suggesting they became notably more democratic and liberal. Ten of them received more net aid in 2014 than five years earlier. Of the nine aid-receiving countries that worsened by two points or more on the same scale, six got less.

But such inducements tend to be subtle, whereas the surge of aid into strategically important states is often huge. Net foreign aid to Turkey, an increasingly autocratic country that is not poor, rose more than tenfold between 2004 and 2014, to $3.4 billion. Besides, donors often have short attention spans. Two academics, Darren Hawkins and Jay Goodliffe, have shown that donors tend to reward countries that are becoming more like them. Once countries have joined the democratic club, aid drops. American aid to Peru followed that pattern. “You get penalised for achieving too high a level of democratic governance,” says Brad Parks of AidData, another think-tank.

Even if Western countries sent clear, consistent signals, they might struggle to be heard. Aid has become less important to many poor countries than foreign investment or remittances. And donors have become far more diverse. Several countries that used to receive aid now hand it out; a few, including India and Turkey, do both. China distributed roughly $3.4 billion last year, according to the OECD. Although that is puny next to America or Britain, China is important because it can act as a shock absorber, moving into a country when others are pulling out. Last month it promised Malawi more food aid and 100 police cars.

For corrupt dictators, Chinese aid is even better than the Western kind. China tends not to fuss over democracy, and it seldom objects to loans being spent on pointless grand projects: after all, it builds a lot of those at home. The money is easier to snaffle. One study found that Chinese aid is highly likely to flow to the districts where African leaders were born.

In one big way, though, the proliferation of donors harms poor countries. Aid now comes from ever more directions, in ever smaller packages: according to AidData, the average project was worth $1.9m in 2013, down from $5.3m in 2000. Mozambique has 27 substantial donors in the field of health alone, not counting most non-Western or private givers. Belgium, France, Italy, Japan and Sweden each supplied less than $1m. Such fragmentation strains poor countries, both because of the endless report-writing and because civil servants are hired away to manage donors’ projects.

Donors would probably do more good by concentrating on a few projects in a few countries. But they strive to achieve the opposite. To them, and to the politicians who control the purse strings, plastering the world with flags is a sign of success. Erik Solheim, chairman of the OECD’s Development Assistance Committee, remembers trying to persuade his own country, Norway, to focus on what it really knows about (managing an oil boom) rather than on things like tropical agriculture. He did not succeed.

A decade ago the approved cure for fragmentation was for donors to pay aid directly to poor countries to use as they please. This has become deeply unfashionable. A donor who funds a government feels responsible for every dismal thing that government does, whether it is passing anti-gay laws or stealing the cash. Once lost, trust is hard to recover. Donors seem disinclined to resume direct budget support to Malawi: one describes it as “in the past”. Britain’s department for international development, which used to proselytise about the virtues of budget support, said last year that it would stop doing it. Increasingly, donors also earmark the funds they provide to multilateral outfits.

The situation is a mess in almost every way. Which is why it is good news that a great deal of progress has been made on one of the ideals agreed on in Paris a decade ago. Donors have become far more open about where their aid goes and how it is spent. It is because of the advances in transparency that we know just how badly things are going. But knowledge and the willingness to change are not the same.