I have played this exact scenario twice in my tables. One was a memorable battle, and the other was a boring dice rolling with low risk. I'll say what I learned from experience.
Don't use swarms or mob type monsters
It is tempting to turn a group of red shirt soldiers into a gargantuan mob. If you understand mechanics, it makes a lot of sense. You gets to control a single monster that may be actually a challenge to your party (instead of two dozen cannon fodder), and there are plenty of templates around that allow you to do that easily. But there is a huge problem on this kind of solution: The players will also see the mob as a single monster instead of a mob. This kills the emphasis you want to make that they are fighting an army by themselves instead of a huge dragon or ogre.
On the same vein, never throw 30 low level mobs on your party. The combat is not risky (the PCs will have larger defense values, and the low level mobs have too low damage to matter), and absolutely boring ("I'll kill another orc").
Focus on the key events of the battle
First off, if there is such a massive battle, there is a good reason for that. One army wants something, the other army wants another thing.Army A can't have what they want because Army B is on the way and vice-versa. So what actually matter here is not the two hundred soldiers colliding. Is which army gets what they want first.
Send the party to kill a specific general. Send the party to cross the battlefield to the McGuffin. Protect the NPCs while they finish the ritual that will make fire rain on the battlefield.
In short, PCs are exceptional characters. They should not be fighting common soldiers when they could be doing the job that no one else could do. Their army have thousands of soldiers willing to die for that cause. Why waste such a powerhouse like a full party of characters with more than 2 levels into just killing soldiers?
Incorporate the chaos on the narrative
Every single action that the players do while under such a battle to include battle actions on the narrative. It is a simple rule, but one that is often forgotten.
Your rogue don't just "stealth around to reach the other side of the field." She will walk behind one of her soldier ally, wait until he kill an enemy mob, wear the cape of the enemy mob, and then advance while avoiding contact with their own soldiers that might think she is an enemy.
Little things like stray bullets arrows flying around and corpses lying on the ground is enough to remember them that the field is dangerous even if they are not actively engaging anyone.
When combat happens, don't turn the whole army against the PCs, but don't ignore them.
You find the big bad general that you are intended to kill. You reveal yourself and prepare to battle. Then the general snaps his fingers and half dozen pikemen appear from the main battle ready to fight you alongside their boss. You ditch the minions, and the general is severely hurt. He calls more minions that will risk their lives so that the boss will have a chance to escape. Some arrows come from an archer in the midst of the main battle. Then another. You can choose to get cover or pursue the boss under a hail of arrows.
Treat the other soldiers as an endless supplies of minions. Make sure that you don't overwhelm them with actual infinite minions (or we are back at the first problem I wrote), but don't be afraid to replace a dead minion with a new minion on the next round. Or adding a new minions every 2-3 rounds.