So, out in the Virginia-Maryland area, long after an apocalypse, tension is brewing between two powerful city states. The Holy Kingdom Of Fredericksburg and the New United States were already bickering about rights to the Potomac River, and when a Messenger boy, who was the nephew of the President, was killed, all-out war broke lose. The Fredericksburg soldiers, who were known as the Bears because of their coat of arms, were led by Prince Heinrich of Fredericksburg. The DC soldiers were known as the Eagles because of their coat of arms. Both sides have guns and cannons, which are about as powerful as ones form the late 17th century. But, since I based the Virginia Maryland area of the Medieval period of Europe, I want to have all the soldiers wearing knight armor, like helmets, breastplates, and mail. So, here is my question: What would be a plausible reason for why the soldiers wear armor when guns and high-caliber weapons are around?
Armor Did not Disappear Overnight
Even after muskets came out there were still soldiers with full body armor. An excellent example of this were the Doppel Soldner mercenaries of the "Pike and Shot" era of warfare. Guns still existed, but needed protection from traditional melee fighters, this came in the form of formations that were 50% pike-men and 50% musketeers. The doppel solder were German mercenaries that specialized in heavy frontal assaults on such formations, they used a combination of handguns, early grenades, and zwei-hander swords to hack and blast their way through these formidable pike forests while under a hail of gunfire from the musketeers. This was horrifically dangerous work which was why the Doppel Soldner's earned double wages "Doppel Soldner literally meaning "double wage earner."
Here is what the later medieval era's melee solution to guns looked like:
You can see that the man wears an odd combination of renaissance baroque finery and semi-plate with chain-mail as well as an archaic but horrifying zweihander sword. These units were in use as late as the 17th century, well WELL past the invention of reliable and accurate firearms and cannon. there really is no evidence to support that men just abandoned trying to utilize body-armor the moment guns were invented, but rather persisted in using it on at least some basis for a few centuries after the invention of fully matured muzzle loading technology.
There are a number of benefits to armor on the battlefield that have nothing to do with protection. It's a display of your wealth, tradition, and power - it shows that you mean business. Having a squad of troops (especially heavy cavalry) in armor could be a valuable psychological weapon, whether that's raising the morale of allied troops (or the wearers themselves), helping them focus on the mission and rallying support for your cause, or inciting fear or panic in the enemy as you're bearing down on them. In this case, I would expect a move towards "half plate" (helmet, breastplate, shoulders) as it's lighter but nearly as effective. Mass infantry formations, which were common in the kind of 17th-century battlefield you're envisioning, don't turn well, so a cavalry charge from an unexpected direction wouldn't necessarily see much incoming fire.
The other major reason things hang around is that militaries tend to be conservative bodies by their nature. In WW1, it took months or years for various armies to acknowledge that things like bright uniforms, cavalry charges, and the like were not the most effective way to fight any more. The first several months of WW2 were no different. There is an inertia to the average military that will defy change, even if it seems suicidal. (And remember, we know that eventually guns will be good enough to break any armor; they don't necessarily know that.) Eventually, the knights will change, but as the author, you can set your story in the period in which they haven't, or even are resisting that change.
The armor might not be steel. This is post-apocalypse. Maybe they retain abilities to work light-weight titanium and found some super-strong alloy. Or the stuff is layered with Kevlar or similar material and only the surface layer is a reflective metal. My point is that it can look identical to Medieval tech but not actually be that tech.
Both sides have guns and cannons, which are about as powerful as ones form the late 17th century
This is a pikemen's cuirass from 1647 with the mark of a firearm.
At that stage, armor still makes sense. Armor 5 mm thick will stil stop a shot at 50 meters,
If your "medieval" guys have cavalry, they can cover those meters in 5 seconds and reloading a weapon in 1700 takes at least 18-20 seconds.
In junior high, we were taught about the first battle of the US Civil War how people came to the field and had a picnic, ready to watch the fight. Even the civilians knew in advance where the fight was going to be and with enough detail to know where they could get a good seat. I know not all battles of that war were like this, but some were. Predetermined spots and times, chosen if not by agreement between the sides then by convention. The 'rules of war' as it were.
For whatever reason these sort of old style conventions have returned. (Post apocalyptic world so that reason could just be 'we don't have enough people around for overly huge skirmishes, lets limit deaths on both sides). Some of the battles are fought like that first battle of the Civil War, where time and place is known. These places it is convention to be mostly melee fights where cavalry does a lot of the work. Most gun use happens in smaller battles usually ambush and hit and run attacks leading up to the main event. Of course both sides cheat because they want to win but for the most part, most of the fights are in such places and times that knight style armor is an aid rather than a hindrance. Places without lots of sniper possibility, where camouflage and muffled movement wouldn't help and where sheer bodily momentum can win the day.
Now take that hill you cur... or something to that effect.
Not to mention that, as far as arm races go, once you create an armor to repel the most common used bullets, the other side will develope a more efficient bullet, or another weapon, to pierce your armor. Unless said armors are made of adamantium, light and indestructible, and that ONE side only has said armors, end of wars, welcome guerrilla and a permanent state of social and political instability.
if weapons are as powerful as ones form the late 17th century. then maybe:
1. Ammunition is scare
And then when it run-out, you need to go old-school.
2. Have the power, but not enough precision
Making only usefull for barrage attacks.
This is one of those times when you, the author, must "declare it to be so"
Heavy, cumbersome, and remarkably uncamoflauged metal armor was quickly discarded in favor of mobility (and later camoflauge) after the development of reasonably accurate firearms. Your knights, if wearing actual plate mail, would be brightly visible sitting ducks for anyone with a good firestick.
You could claim a religious mandate, or have an ultra-powerful political figure who passes a law, but all this will quickly deteriorate as small bands of boomstick-weilding brigands mow down the knights. Bereft of their defensive force, said religious and political leaders will quickly face the ire of widows and orphans.
You could handwave a very light, very strong metal (let's call it "Mithril") that could withstand small arms fire (until something stronger comes along, such as a mithril bullet), but that's a brief stop-gap.
Unless you declare it to be so.