There comes a time when, no matter how well developed your characters are, no matter how exciting an adventure is and no matter how great your group of players is, your fantasy set RPG sessions may get a little stale. There are many ways to liven up these sessions, but one that I enjoy is fighting a war.
There are plenty of preexisting tabletop games that allow you to command space armies or medieval armies, but what I'm suggesting is taking established PCs and having them command troops on the field of battle or survive the siege of a castle. The introduction of armies will give your players the opportunity to use strategy and be rewarded for it. Plus it can be a refreshing break from slaughtering kobolds and raiding treasure chests.
There are two ways that I have run a campaign using armies and which way you pick will determine the best way to incorporate them into your campaign. There are probably many other ways that you could introduce armies. As always, come up with a solution that works the best for your group.
The first scenario is a campaign where the players command an army fighting against an enemy army directly controlled by the DM. This is the easier and more straightforward way to run a campaign with armies. The enemy army could be made up of marauding undead or a rival kingdom of humans or elves. You can use whatever works for your campaign. This scenario is easy enough to introduce into an existing adventure. For example, the party has just returned from to rescuing the child prince of the Kingdom of Acavia from a band of ogres. The quest was arduous and on the journey, the party was forced to slay a band of what they assumed to be highwaymen. In reality, those "highwaymen" were legitimate toll collectors from the neighboring kingdom whose land the group had inadvertently trespassed on. That kingdom took this as an act of war. Whoops!
The second scenario involves splitting the players into sides and letting them fight a war against each other. In this case, the DM would act as more of a referee than a participant. For narrative purposes this option would require a lot more story-telling creativity to introduce into an existing campaign. It can be done, but the DM has to lay the groundwork for the split well ahead of time. Sowing the seeds of discord within the party will make the eventual taking of sides in a war fit better into the story. A good example of this is to have the party working mercenary jobs for two warring groups. The party is of course working for each side without the others' knowledge, but eventually some members of the party start to question whether they should be offering their services to what they deem the "bad" side. It's very easy to split the group this way according to variations in their alignment.
There is a variation of the second option where you don't even bother to come up with a reason for the players to command opposing armies. It can be done just for the sake of breaking up the monotony of role-playing.
The DM is going to have to do a lot of the heavy lifting when setting up both sides of the army if the PCs are commanding troops against an enemy force. It's simple enough to determine the layout of a feudal army using what we know from history. There will be most likely be archers, foot soldiers and a small force of mounted knights. In a fantasy setting, the army will also include war mages and clerics deployed among the troops. The DM can build an enemy army along the same guidelines; replace mounted knights with wolf riders, replace mages with shaman, etc.
Set the armies up with stats that are appropriate for their role. Foot soldiers and archers are basically fodder. Mounted knights should have better stats. If you feel like making things more realistic, you can create some veteran troops that have better stats to mix in among the armies. If the PCs are waging war against each other, allow each side to have input in the construction of their own army, but do it separately so the other side doesn't know the exact make up of the army they are facing. This will give each team the chance to come up with the strategy they think is best, but it might end up being the worst.
If you are running a PC versus PC battle, the players may want to use things like catapults, trebuchet or ballista. As the DM, this gives you the opportunity to expand the realism. Since most armies didn't travel with these larger weapons of war, they were built on the spot. Force the players to make the choice between creating the craftsmen who will build them or soldiers to fight.
Once the armies are created, it is time for the players to take command. The simple solution would be for each player to take charge of the combat element that matches closest to their class, e.g. wizard in charge of wizard, paladin in charge of knights, etc. If the players want to do it a different way, let them, but consider enforcing some kind of penalty to morale checks. In real life a group of knights would not trust a cleric to lead them and once they started dying this mistrust would grow.
You might think that running the combat between two large armies is going to be a never ending exercise in dice rolls, but it doesn't have to be. There are tricks that you can use to make the game play just slightly more involved than typical dungeon crawling. The easiest way to run large scale combat is to divide each type of troop into groups of 5, 10, 25, whatever you decide. Then use group dice rolls for combat, saving throws and damage.
For combat and saving throws, determine the roll that is needed for success. Then roll the dice and look at the result. An unsuccessful dice roll is still just that, but we have to look more closely at a successful roll. For every number the roll is above a successful roll, the roll is incrementally more successful. Here's an example: let's say a group of 10 archers is engaging an advancing group of 10 foot soldiers. The archers need to roll a 15 to hit the archers. If the roll is a 14 or lower, all of the archers miss. If the roll is a 15, then two of the archers hit two of the soldiers. For a 16, three of the archers aim is true. Roll a 20 and all of the archers are hit.
Saving throws work the same way but in the opposite direction. A successful saving throw means everyone saved. The less successful a non-successful saving throw is, the more troops there are that failed the save. No matter how the math works out, a natural 20 on an attack means everyone got hit and a natural 1 on a save means everyone failed. Damage from attacks or failed saves can be rolled as normal.
Morale checks are going to be an important part of army combat. Even the most highly disciplined troops are going to have a hard time holding the line during a slaughter. As the DM, determine ahead of time what the breaking point will be for each type of troop. Rookie foot soldiers may break ranks if the sustain ten percent casualties, whereas knights will probably battle on even with 75 percent losses. Once the casualty rate reaches the point you have determined, start making morale checks every turn. Treat morale checks the same way you did saving throws. The worse it is failed, the more troops cut and run. You can also add in a mob mentality factor. If a morale check is failed on a turn and troops run, on the next roll add in a penalty. The more troops that run, the higher the likelihood that their compatriots will follow suit.
The PCs are usually going to be more than a match for normal soldiers in combat, but the idea is not for them to lead the charge into combat; they should be commanding the troops that are under them. You may have players in your group that want to charge right into the fray while their soldiers stand around behind them. Make sure that the enemy and the troops respond in an appropriate and realistic manner. If someone on the battlefield is clearly doing the most damage, more attention (meaning more attacks) would be focused on them. Also soldiers who aren't being told what to do will have a higher likelihood to run away. Encourage the players to lead the troops, not be the troop.
It would be easy to add up all the enemy combatants that are killed and award each PC their share of the total experience. I would recommend that the DM be a little choosier when determining experience awards for army combat. First off, the PCs should not have actually gone out and singlehandedly killed all the enemy soldiers. There should always be a substantial percentage drop in XP awarded. A fair way to award XP to the players is to look at the battles that they commanded. If they had fifty friendly troops facing off against fifty enemy troops, look at the rate of enemy casualties to casualties sustained. If the PC lost 49 soldiers to defeat 50, they should be awarded a very small percentage of the normal XP. Don't reward bad combat strategy.
The DM can always use their discretion to add in XP for exceptional acts during the battles. If somehow your paladin was able to rout 200 orcs with a force of 25 knights while only sustaining two casualties, they should be rewarded for this. Along with XP, the DM may also want to consider the awarding of treasure or items. Surely a wealthy king would present his generals with gifts after a successful battle.