Why did Nazi Germany build concentration camps in Poland?
Because of the huge concentration of Jews in eastern Europe, particularly in Poland.
When the Germans invaded Poland in 1939 and then the Soviet Union in 1941, they occupied territories within which there were several million Jews.
Initially the Nazis along with local militias shot huge numbers. Special squads, called Einsatzgruppen were used for this purpose.
However there were so many Jews, shooting no longer became an option. A more humane way was needed, more humane that is for the killers not the Jews, as even hardened SS members became psychologically damaged.
The decision was taken to use Zyklon B to gas Jews in gas chambers designed as showers. At camps such as Treblinka Chelmno and Auschwitz-Birkenau millions were killed by this method.
The train timetables of Europe were organised to transport the Jews, and other groups to these camps.
A final point to mention is that concentration camps and extermination camps were not the same thing. At concentration camps inmates were worked as slave labour to help the German war effort. Extermination camps were for liquidating millions. Sometimes camps such as Auschwitz-Birkenau served both purposes; hence the selections as people arrived off the trains.