One of the meanings of the word pitch is “to set things in order.”
For example, when you pitch a tent, you are using a military expression for lining up the tents in rows.
Unlike a skirmish or a surprise attack, a pitched battle was one in which the two sides lined up in formation facing each other until the order was given for the carnage to begin.
The two disciplined sides held their ranks as they approached and then met each other in what was called a pitched battle.
An all-out fight is called a “pitched battle”.