To quickly exterminate the jews, the Nazis put them dozens at a time in gas chambers. After they were gassed they were burned in crematories. These gas chambers were the quickest and most efficient way to kill the Jews.
These pits allowed the Nazis to keep up with the exterminations and hide the evidence. They threw the Jews in the pit, doused them in gasoline, and tossed the mach. burning hundreds of Jews at the same time.