The border actually follows the Lusatian Neisse, and then the Oder river, except in the vicinity of the port city of Szczecin; this is the border set by the Allies at the Potsdam Conference after the end of World War 2.
The mine on the eastern side of the river became Poland, but it was still supplying a power plant on the west side of the river in East Germany [1]. Later, in 1962, Poland built its own power plant [2].
The Soviets and the Polish wanted to push this border as far west as possible, while the western allies wanted to set it was far northeast as possible to more closely approximate the German-Polish ethnic divide at the time. Various compromise options were proposed, following various rivers, but in the end the western allies agreed to the Soviet proposal. Germans in these territories gained by Poland were expelled. (Meanwhile, the Soviets took the eastern half of previous Poland and made it [3] part of the Soviet Union, specifically the constituent republics of Belarus, Ukraine, and Lithuania... it was a messy time.)
[1] https://de.wikipedia.org/wiki/Kraftwerk_Hirschfelde [2] https://en.wikipedia.org/wiki/Tur%C3%B3w_Power_Station [3] https://en.wikipedia.org/wiki/Kresy
> Poland must pay a daily penalty of €500,000 ($585,550) for ignoring a previous order from the European Union’s top court to cease operations at the Turow lignite mine, with its CEO slamming the fine as “bizarre”.
> On Monday, the EU’s Court of Justice (CJEU) confirmed it was enforcing the financial penalty against Warsaw, stating that Poland must pay the European Commission the daily half-million euro fine until it sees compliance with the earlier order.
> Judges from the Luxembourg-based court said that the fine is “necessary… to deter that member state from delaying bringing its conduct into line with that order.”
> https://twitter.com/EUCourtPress/status/1439940814046744581?...
> The Czech Republic took legal action against Poland in February over activities at the mine, which also sits close to the German border, claiming that it spoiled its citizens’ drinking water. After Warsaw failed to obey the court orders in May to “immediately cease lignite extraction activities at the mine”, Prague asked the court to fine Poland €5 million per day.
> Poland is widely hated by its neighbors for the existence of this mine. The mine is also in a hilarious geographic location if you look it up on the map. It's BARELY within the country.
Wow. Turów Brown Coal Mine https://maps.app.goo.gl/3GZHsBabN8rwPqZTA