In 5E, fighters can only take down at most 4-5 NPC's per round, 8-9 in the first couple rounds, plus one with a reaction... but they won't be hitting all the time.
They probably will be, given their + to hit at 18th level with ability improvements, magical items, proficiency bonus and the fact that villagers don't wear plate due to the fact that its difficult to farm in it.
The guards will take 2-3 hits each, maybe more. The knights (with 50HP) need at least 4 hits. (snip) The wizard, at 18th level, can take out a couple waves himself, if they come in clumped. But they won't after the first clump; The spellcasters in 5E are far less dangerous to crowds than equivalent casters in prior editions. Still far more dangerous than a fighter of same level, but no more 20d6 fireballs (it peaks at 14d6, an average of 49 damage - not enough to assure drop a knight's or Veteran's 52 HP). And, unlike AD&D, there's no x10 radius for being outside...
Hmmmm, your table use morale much? You're solely looking at meat points. I'd hate to play with a DM with that mindset of numbers only. Even so your villagers aren't endless and neither are your veterans/knights. You're welcome to test it with your playgroup and report back on it.
However, if they attacked in small groups and attacked a few at a time without giving the high level party time to rest? Especially if they can do so in a place that the party has limited room to manoeuvre... it could easily get unpleasant.
Seriously doubt it. Cantrips scale. Melee swings are auto. So with a party of 4 x 18th level, great so you're losing at least 5-10 villages a round. How many villagers in your village?
I'd probably start such a scenario with a thief attempting to steal their belongings while they slept, then have attacks start in wherever the party are staying. Probably have them send some people into the building to die, barricade it up and set fire to it. Sure, an 18th level party will get out of that, but at a cost in resources.
Very few as stated above, they don't need much to clear out the first clump and take out the minor waves you predict thereafter with at-wills.
Once they escape the building, they will constantly face ambushes by groups of townspeople, most of whom look alike - they won't know if the five attacking them are all commoners or if they have a thug present who can hit a lot harder. The scouts would hide in sniper positions, attacking any time they had line of sight and moving to a new position after.
Yeah, honestly this sounds like a ridiculous scenario and for you to be even considering this as challenging is beyond me. I suggest you try this with your playgroup and let us know how it goes, I think it might prove interesting, but remember in this scenario - villagers are bad people, we are not discussing ethics/morals. So they're bad, kill = good, therefore no remorse.
Now, this isn't going to be a deadly encounter. You would need to include a lot more creatures with better stats than a village would have for that. But it could certainly be made with medium or hard difficulty.
My initial statement spoke of a village and this conversation/debate was about 18TH level PCs fighting a village, if you're adding to it then this conversation/debate is over. But even so, at 18TH level I'd imagine the adventures to be a little more interesting than fighting off mad-crazed villagers - I cry borgasm, loudly! At that level of power (freaking 18TH), I wish to be playing planar-themed adventures, not wasting my time with villagers, tavern drinking competitions and overseeing crops, sorry - that is my preference. I'm not eagerly anticipating THE EPIC LEVEL VILLAGE ADVENTURE from WotC, just saying.
And yes, the party could use one of a number of spells to avoid the encounter entirely. But they could do that with any number of threats, including some deadly ones.
What are you getting at here, I'm missing it entirely?
If the party run away from fighting an entire village, I think that demonstrates that the village has a real possibility to damage them!
I prefer rewarding smart play than playing a game of meat points vs meat points. A test of meat point attrition, in this scenario, is not appealing, IMO.