When it comes to armies fighting, there are a few ways to go. I've tried a few different paths, but for a number of reasons, I now stick to only one.
Option 1: Convert the armies into monster stats and go at it with the PCs controlling armies. This can be a fun little minigame, but you end up putting a lot of work into setting up the encounter and getting the balance right is often a struggle. Further, when dealing with massive armies, certain things don't make as much sense when translated to the basic combat rules (especially around movement and terrain). I've done this a lot, and it has mostly underwhelmed.
Option 2: Import a mass combat system. This works fine if everyone knows the system already, but if not, it ends up being a lot of time explaining for a one off situation.
Option 3: Move it to the background. The battle rages on around the PCs, but we only focus on the PCs. Usually, we determine that the battle has a key element. It might be taking out an enemy leader, it might be protecting something, it might be opening a hole in the enemy lines... whatever it is, the PCs are doing it. The battle has two potential predetermined courses - one if the PCs win, one if the PCs fail. This keeps the attention on the PCs, where the attention should be, and is easiest on the players. It also allows for the most dynamic storytelling. This is the only approach I take these days outside of unusual circumstances.
A fairly recent example:
PCs were part of a nation that was being attacked by overwhelming invading forces. The locals had no chance of repelling the enemy, and the enemy was dead set on exterminating the entire population. The invading forces had pushed into the nation from multiple sides, forcing the population back towards the capital city. There was an overwhelming number of people that fled to the city for protection, and were now being evacuated by ships - when there were far too few ships for the number of people there. The PCs arrived a day ahead of the invading army and had a lot of potential goals they wanted to achieve, many personal (get their families on ships), others heroic (fight off advanced scout parties), others political (make sure that it wasn't just the rich and powerful on the ships, but the people that would be needed to rebuild elsewhere), others greedy (looting!). However, when the armies arrived, they found themselves tasked with escorting the only good person in the royal family from the front gates of the city to a ship. I'd prepared 9 different encounters, and the decisions they made as they went across the town determined which they'd face. Each one had the potential for success or failure. Some would be failed if the royal died or was captured. Others had no risk of that, but the way the PCs overcame the challenge would alter the story going forward (do they force open the inner gates and release a massive swell of people into the dock ward where they'd interfere with the loading of the ships?) In some of the encounters, random destruction rained down at predetermined times.
I could have run this as a defense mission with the PCs controlling the royal defenses against an overwhelming attacking force, with the length of time the PCs held on determining how long people had to get to the ships, etc... but I find it more compelling to have those impacts come from personal stories of the PCs rather than the massive warfare.