Simple math mixed with ruthless debaucherie.
How to kill all those people with the very least amount of resources wasted is a tough job. There were lots of gun to the head: way to slow, bullets became scarse too as things progressed. Those about to be shot were lined up in single file, usually 6 in a row, then the first one was shot in the head with a rifle from close range to let the bullet pass through the first few in the line, sometimes more, sometimes less, to save rounds. Then those last in line were moved up, and more took the back of the line.
Soon even that became wastefull and getting the victims just to lay down in a big ass ditch and just bulldoze the dirt over the still living worked well, but was also wastefull. All those gold teeth, spectacles, belt buckles, buttons, clothes, shoes etc might be usefull, certainly the metalics were used.
SOOO... camps where slave labor could be used, farmed out to munitions plants, chem plants etc were used to support the war effort. No waste, prisoners built everything, managed the guard duties to a large extent in the form of yard capos, extracted the gold from the teeth of the dead, burried the dead, dug up the previous mass graves, etc.
That was all before the need to get rid of the 'evidence' as the war was clearly being lost, the real xyclon b gas chambers and the production ovens were ramped up to full capacity. Cheap, effective disposal of the 'problem'.
Please remember that it was not just jews, but 13+ million total killed: jews, gypsies, blacks, gays, the metally ill, the phyiscally challenged, the intelligencia and anyone related to the above if you couldn't pay/had a bad attitude/got the wrong guy that day.
The deaths of six million jews is horrendous. The gypsie culture was all but completely exterminated from europe. The best and brightest (read: those who where smart enough to complain/protest/try and do something) erased from the lands of the reich.
Dark history and as horrible as it is, it doesnt hold a candle to what the spaniards did in the new world. They had centuries to do it, but some estimates put the number over a hundred million.