Apparently about 90% of Poland's Jewish population was murdered during the Holocaust, compared to Germany's ~35%. Why did the nazis concentrate on Poland (and other occupied territories) instead of their own land? Or did the local Jews have more time to run away or something? What happened?
The different death tolls of different Jewish populations reflect a number of factors, from the size of the prewar Jewish populations and their socioeconomic circumstances to the different policies applied at different points during the war. You asked specifically about Germany and Poland so I’ll focus my response on those populations comparatively.
The German-Jewish population numbered about 500,000 when the Nazis took power and was overwhelmingly middle class. For the first six years or so of the Nazi regime, Jews were strongly encouraged to emigrate, and many did because they had the economic means to do so. Therefore, only around 150,000 were in the country by the time the war began. Deportations of German Jews to ghettoes in occupied Poland the USSR began in the fall of 1941 but mass murder of deportees did not become common until the following year. German Jews not deported directly to death camps had a better chance of surviving if they did some kind of work that was necessary to the German war effort, and many did.
In contrast, there were 3 million Jews in Poland when the Nazis, most of whom had no ability to escape once their country was invaded. Being mostly working class or poor, their ability to negotiate an exit of some kind and their access to resources for survival were comparatively limited. Even those Jews who fled east upon the Nazi invasion of Poland eventually found themselves subject to Nazi rule with Operation Barbarossa, after which point the Jewish policy became explicitly exterminationist. A number of unforeseen factors — mainly the overcrowding in Jewish ghettoes in Poland and consequent concerns for public health, reluctance of many German soldiers to engage in mass shootings, and the inability to knock the Soviets out of the war in fall 1941 — resulted in distinct plan to exterminate Polish Jews, called Aktion Reinhart. This program was overwhelmingly successful: 90% of Polish Jews were murdered. The only way out was proving useful for forced labor, but even then the end goal was extermination once exhaustion made labor no longer an option.
There is an enormous literature on the Holocaust, obviously, but a key text explaining Nazi decision making and its evolution before and during the war is Christopher Browning’s Origins of the Final Solution. An excellent overall source on the Holocaust and particularly on prewar escalation of Nazi Jewish policy toward extermination remains Raul Hilberg’s Destruction of the European Jews. Finally an excellent recent work with this focus is Christian Gerlach’s Extermination of the European Jews.