By the terms of the 1945 Potsdam Agreement signed by the three victorious Great Powers, the Soviet Union retained most of the territories captured as a result of the Molotov–Ribbentrop Pact of 1939, including western Ukraine and western Belarus, and gained others.
Poland was compensated with the bulk of Silesia, including Breslau (Wrocław) and Grünberg (Zielona Góra), the bulk of Pomerania, including Stettin (Szczecin), and the greater southern portion of the former East Prussia, along with Danzig (Gdańsk), pending a final peace conference with Germany which eventually never took place. Collectively referred to by the Polish authorities as the "Recovered Territories", they were included in the reconstituted Polish state. With Germany's defeat Poland was thus shifted west in relation to its prewar location which resulted in a country more compact and with much broader access to the sea.The Poles lost 70% of their pre-war oil capacity to the Soviets, but gained from the Germans a highly developed industrial base and infrastructure that made a diversified industrial economy possible for the first time in Polish history.
The flight and expulsion of Germans from what was eastern Germany prior to the war began before and during the Soviet conquest of those regions from the Nazis, and the process continued in the years immediately after the war. 8,030,000 Germans were evacuated, expelled, or migrated by 1950.
Early expulsions in Poland were undertaken by the Polish communist authorities even before the Potsdam Conference, to ensure the establishment of ethnically homogeneous Poland. About 1% (100,000) of the German civilian population east of the Oder–Neisse line perished in the fighting prior to the surrender in May 1945, and afterwards some 200,000 Germans in Poland were employed as forced labor prior to being expelled. Many Germans died in labor camps such as the Zgoda labour camp and the Potulice camp. Of those Germans who remained within the new borders of Poland, many later chose to emigrate to post-war Germany.
On the other hand, 1.5–2 million ethnic Poles moved or were expelled from the previously Polish areas annexed by the Soviet Union. The vast majority were resettled in the former German territories. At least one million Poles remained in what had become the Soviet Union, and at least half a million ended up in the West or elsewhere outside of Poland. However, contrary to the official declaration that the former German inhabitants of the Recovered Territories had to be removed quickly to house Poles displaced by the Soviet annexation, the Recovered Territories initially faced a severe population shortage.
Many exiled Poles could not return to the country for which they had fought because they belonged to political groups incompatible with the new communist regimes, or because they originated from areas of pre-war eastern Poland that were incorporated into the Soviet Union. Some were deterred from returning simply on the strength of warnings that anyone who had served in military units in the West would be endangered. Many Poles were pursued, arrested, tortured and imprisoned by the Soviet authorities for belonging to the Home Army or other formations, or were persecuted because they had fought on the Western front.
Territories on both sides of the new Polish-Ukrainian border were also "ethnically cleansed". Of the Ukrainians and Lemkos living in Poland within the new borders (about 700,000), close to 95% were forcibly moved to the Soviet Ukraine, or (in 1947) to the new territories in northern and western Poland under Operation Vistula. In Volhynia, 98% of the Polish pre-war population was either killed or expelled; in Eastern Galicia, the Polish population was reduced by 92%. According to Timothy D. Snyder, about 70,000 Poles and about 20,000 Ukrainians were killed in the ethnic violence that occurred in the 1940s, both during and after the war.
According to an estimate by historian Jan Grabowski, about 50,000 of the 250,000 Polish Jews who escaped the Nazis during the liquidation of ghettos survived without leaving Poland (the remainder perished). More were repatriated from the Soviet Union and elsewhere, and the February 1946 population census showed about 300,000 Jews within Poland's new borders. Of the surviving Jews, many chose to emigrate or felt compelled to because of the anti-Jewish violence in Poland.
Because of changing borders and the mass movements of people of various nationalities, the emerging communist Poland ended up with a mainly homogeneous, ethnically Polish population (97.6% according to the December 1950 census). The remaining members of ethnic minorities were not encouraged, by the authorities or by their neighbors, to emphasize their ethnic identities.