Post-World War II Poland was "designed" by the British foreign office, presented by Churchill, and ratified by Roosevelt and Stalin at the Tehran Conference in 1943, as noted in another answer.
After World War I, Britain had planned on the so-called Curzon line for the eastern boundary of Poland (based on the ethnic divisions) but the country crossed that boundary in 1919-20 and seized chunks of Belarus and the Ukraine east of that line from the Soviet Union. The 1939 German-Soviet partition line actually coincided almost exactly with the Curzon line, with minor differences. Hence, it was easy for Britain and the Soviet Union to agree on the final eastern boundary of Poland.
In compensation, Churchill's plan was to restore to Poland land that had been "German" for two or three centuries, but had been Polish earlier in the Middle Ages. These included Silesia and Pomerania. As a practical matter, the new western border was set on the Oder and Neisse rivers, meaning that some small pieces of German (East) Brandenburg east of the line went to Poland, and some small pieces of former Polish Pomerania went to Germany.
Silesia had originally been Polish, was inherited by the heir to the Bohemian crown, and ultimately by Austria, when the Bohemian royal line died out. It was captured by Germany (Brandenburg-Prussia actually), in the War of the Austrian Succession in 1740, which is why it became "German." All this over a period of several centuries.
Pomerania (Polish for on the sea) was originally held by Polish dukes. When they started accruing land west of the Oder in the 12th century, this portion of Pomerania was held as a fiefdom under the Holy Roman Emperor. Eventually, the German influence won out, and all of Pomerania was under the Holy Roman Empire, or one its Electors, that of Brandenburg. During the Middle Ages, there was a certain amount of back-and-forth, but the end result was increasing German settlement and influence on Pomerania, particularly west of the Oder, less so under the east, while nominally under a Polish noble line, the Griffins. When they died out around 1650, Pomerania was divided between Sweden and Brandenburg-Prussia, with the latter eventually absorbing the Swedish portion over the next century or so.
All of the above as justification for the Allies doing what the wanted to do, transfer these lands from Germany (back) to Poland, and the Soviet Union taking back the pieces of Belarus and the Ukraine occupied by Poland.