Why did ancient wars often use "pit killing" to kill prisoners of war?

Pit killing is not burying the body alive, but killing the enemy. More often, the chopped heads are piled into a certain shape and volume according to a certain number, and then sealed with soil. This is the first time that the king of Chu has done such a thing.

In the battle of Changping, Qin Jun drove the defeated troops of Zhao into valleys and ravines with cavalry, and then attacked Zhao's soldiers with bows, arrows, rollers and stones, killing them. Qin Jun himself could only eat one meal a day at that time. Where did he have the strength to dig a hole and bury it alive? After the Battle of Julu, Xiang Yu's Xin 'an murder surrendered, but surrounded Qin Ying, directly attacked and killed Qin Jun.

Later, historians used pit killing in history books to compare the cruel acts of killing prisoners and massacres, which may not be true pit killing.