E VERY YEAR for the past seven years, Halyna has taken time off from her waitressing job in Zakarpattia, in south-western Ukraine, to lead a team of Ukrainian fruit-pickers on a farm outside Krasnik, in eastern Poland. She stays for one month or several, depending on her papers. Working from six o’clock in the morning until the evening, she can earn three or four times more a day than she does at home.

Locals once picked Poland’s fruit and vegetables. That changed in 2004, when the country joined the European Union, and Poles were permitted to work in Britain, Ireland and Sweden. Over the next seven years the rest of the EU opened its doors. Unemployment in Poland has fallen sharply and wages rose by 30% in real terms in 2004-17, according to the OECD , a rich-country club. Field work seems less appealing to Poles these days.

Migrants from the east have replaced the locals. This year around 500,000 seasonal workers from outside the EU worked on Polish farms—up from fewer than 200,000 in 2014. Some have been busy since early summer, picking strawberries, then raspberries, then apples. They are the largest group of legal migrant farm workers in any rich country. But there are plenty more elsewhere.

In 2013 America’s federal government allowed farmers to fill 99,000 jobs with temporary foreign workers, most of whom came from Mexico. This year it is on track to let in about 240,000. A Republican-sponsored bill would raise the limit to 450,000 a year and allow them to stay for up to three years. Germany—which, like other European countries, has opened its fields to workers from Bulgaria, Romania and other eastern EU member-states—also admits about 60,000 Ukrainians a year. Smaller programmes in Australia, New Zealand and South Korea are growing fast.

Even politicians who rail against immigration tend to make an exception for seasonal farm workers. “We’re gonna let them in,” said Donald Trump in May. While welcoming foreign farm workers, Poland has fenced out refugees. Britain’s government interprets the vote to leave the European Union primarily as a vote against open borders. Even so, in September it announced a special programme to bring in seasonal farm workers from outside the EU .

Perhaps it is because farmers are so good at lobbying politicians. Perhaps it is because, at least in theory, migrant farm workers go home in winter. Perhaps it is because many workers live in trailers on farms, where they are invisible to the general population. Perhaps it is because many of them are white. Whatever the reason, seasonal agricultural labour has become a big exception to the rule of ever-tightening borders and ever-harsher anti-migrant rhetoric in rich countries. And this global flow of workers has changed farming.

In many rich countries, including America, Britain, France, Ireland, Italy, Spain and New Zealand, agricultural employment had been in long-term decline as a share of total employment. About ten years ago the decline stopped. With more workers available, farmers have been able to grow more of the kind of crops that require careful handling.

In Britain asparagus and soft fruit are now planted more widely than in 2004, when the country opened its doors to Polish and other eastern European workers (see chart). And though cause and effect cannot be disentangled, this might have changed British eating habits. Britons munched more than twice as much soft fruit in 2017 as in 2000. “People eat blueberries for breakfast,” says Jack Ward, head of the British Growers Association. “Ten years ago, that didn’t really happen.”

The depth of farmers’ dependence on migrant workers is clearest when the workers fail to turn up. Earlier this year Slawomir Brzusek learned that the Ukrainian women who were supposed to work on his farm near Krasnik would not be coming. Their leader had found an indoor job in Warsaw. “It was a time of uncertainty. The raspberries were ready; I was truly worried,” he remembers. Eventually he found other workers from Ukraine, though not quite enough to pick all the raspberries in his fields. He told the workers to pick the nicest berries and leave the rest. When the schemes are well run, seasonal migration can transform people’s lives. New Zealand’s “recognised seasonal employer” programme began in 2007 with 5,000 migrant workers and has grown to 11,000. Almost all the workers who take part in this scheme are men from poor Pacific islands such as Tonga and Vanuatu. They are housed by New Zealand farmers, who also pay half the cost of their return tickets and guarantee them a certain amount of work. If the workers fail to depart at the end of the year, the farmers must pay for their removal. When John Gibson of the University of Waikato and David McKenzie of the World Bank evaluated the programme in 2014, they found huge effects. The average worker from Tonga or Vanuatu earned NZ$12,000 (currently $7,900) in a season, of which he sent NZ$5,000 home. After two years, households with a migrant member had higher incomes and savings, and nicer homes, than similar households without one. Few development programmes can boast such good results. To prevent migrant workers from undercutting natives, New Zealand’s farmers must show they have tried to hire local people, and must pay migrants more than the prevailing wage. These measures are probably pointless. In most rich countries, locals will not do repetitive farm jobs for the wages on offer. Since 1999, Germany has tried several times to restrict the number of foreign migrant workers, in order to lure unemployed locals into the fields. These efforts have had little effect, partly because unemployment has been low in the areas where labour-intensive crops are grown.

Foreign workers are self-regulating, points out Philip Martin, who studies migrant labour at the University of California, Davis. Because there are usually more willing migrants than farm jobs, and because workers tend to be hired in groups, they have a strong incentive to behave impeccably and ensure that others do, too. In the most recent survey, 90% of New Zealand farmers rated Pacific islanders at least eight out of ten for dependability. Just 22% gave similar scores to local workers. A farmer who comes to depend on foreigners might never go back to locals.

If migrant farm workers impose a cost, it is probably in innovation forgone. Some farmers who employ lots of migrant labourers are keen on labour-saving machinery (see article). But they seem to be unusual. In general, a plentiful supply of willing workers appears to deter growers from investing in technology. That became clear in America when the tap was turned off.

In the early 1960s President John F. Kennedy abolished the bracero programme, which had allowed almost half a million Mexicans to work on American farms. The aim was to boost employment and wages for native workers. That did not happen, according to research by Michael Clemens, Ethan Lewis and Hannah Postel. Farm wages rose after the Mexicans were sent packing—but they went up at least as much in areas where there had been no braceros. Instead of hiring more Americans, farmers invested in things like tomato-picking machines and stopped growing crops that could not be mechanised.

Engineers continue to work on machines that could replace workers. Garford Farm Machinery, a British firm, has created a robotic weeder that can be attached to a tractor. Inevitably called “Robocrop”, this takes out not only weeds growing between rows of crops (which any old machine can do) but also weeds growing between plants in a row. Prices start at £80,000 ($105,000); Philip Garford, the managing director, says that it can do the job of 30 men with hoes. Other inventors are working on strawberry-picking robots. But strawberries are tricky—and raspberries, which must be pulled gently off hulls, trickier still. “If someone invents a mechanised way to pick raspberries, they will win a Nobel prize,” says Andrzej Tybulczuk, director of Krasnik’s employment office.

What worries Poland’s farmers is the danger that Ukraine’s store of willing workers will be picked clean. Ukraine’s young adult population is shrinking because of its post-communist baby bust, and farmers in Germany and Britain can pay higher wages. Polish farmers will probably have to look further afield, perhaps to South Asia or sub-Saharan Africa, whose workers will stand out more in an overwhelmingly white country. But if it works in New Zealand, perhaps it can in Europe.