ONE-SIXTH of the world's 5 billion people live in the rich countries -- those that are at least as well off as, say, Spain or Ireland. A great many of the other five-sixths would like to move, and that creates immigration issues of great social and moral complexity for their more prosperous neighbors. The politics of border controls is hard enough to manage with decency and justice along the southern borders of the United States, but the same questions are even harder to answer in Europe, where the right to travel is among the most cherished of the freedoms that the past year has brought to the Eastern countries.

Europe now seems to be embarking on the third great migration since World War II. The first was east to west as some 12 million people, most but not all of them Germans, either fled or were forced out by the new Communist regimes. The second, in the boom of the 1960s, was south to north as an almost equal number of people, mainly from Turkey, Yugoslavia and North Africa, were drawn into Western Europe's cities and factories to meet an urgent need for labor. The third migration is east to west, still small in numbers but with a potential for growth that is generating great anxiety in the governments that will have to cope with it.

When Germany and Poland signed the treaty Wednesday establishing their border permanently, the Germans promised to abolish all visa requirements for the Poles by the end of the year. Even with visa requirements, Poles have managed to travel in the West for some time, frequently staying a few weeks or months to work illegally. Like illegal immigrants into the United States, they have been subjected to much abuse and exploitation.

But the Poles, for all of their current troubles, are far from the least fortunate of Eastern Europeans. The Polish government is now making preparations for a possible flood of refugees from the Soviet Union if hardship and ethnic hostilities should increase this winter. Poland hasn't much in the way of resources to handle a heavy inflow, but it says that it must keep its border open as a matter of principle.

The West is aware of the requirements for long-term investment and economic aid to rebuild the Eastern European economies, and there is beginning to be talk of a possible need to help the Soviets through the coming winter. But perhaps before spring comes the rich countries will also find themselves facing the social emergency that would be created by the arrival hundreds of thousands of refugees from the poverty of the East.