The Scouring of the Shire was probably inspired in PART by real conditions in England in the aftermath of the two World Wars, but it also has parallels in many ancient epics.
Start with Homer’s Odyssey- after fightng in the Trojan War, Odysseus spends years trying to get back home. And what does he find there? His kingdom is in shambles, and his palace is filled with revelers who all want to replace him. His baby son is now an adult, his beautiful wife is an old woman, and nobody even recognizes Odysseus except a flea-bitten old dog and a pig tender. Odysseus has to take up arms and reclaim his kingdom by force.
What was Homer getting at with the story of Odysseus’ return to Ithaca? Simply this: we KNOW that our adventures and travels will change us over time, but we somehow imagine that the homes we leave behind will stay the same forever. When we’re away from home for long periods, we get nostalgic, and long to return and see the familiar faces and places we loved. But if we do return, we’ll find that home hasn’t stayed the same. How could it?
That’s the general lesson that Homer and Tolkien taught us… but Tolkien’s particular portrait was probably affected by the changes he saw in England after he returned from World War 1 and the changes countless ordinary British soldiers saw in England when they came home after World War 2. It might be years before England was rebuilt and before Tommy could settle down to anything like a happy normal life again.
I’ve given this spiel before, in almost the same words (forgive me if it sounds familiar): how did “Tommy Atkins,” the ordinary English soldier, make it through Dunkirk, El Alamein and the Normandy invasion? The same way Sam Gamgee did- by thinking constantly about the small comforts and pleasures that awaited him when he got home. Sam Gamgee and Tommy Atkins dreamed of eating their favorite foods again, of having a good smoke with their old mates again, having a pint at their favorite local pubs again, of dancing with pretty girls again!
But when they did return to their respective homes, both Sam and Tommy were in for a shock: in their absence, Sauron/Saruman and Hitler had made their presence felt back home. Tommy found that his parents had gotten old and frail while he was away, that many of his favorite haunts had been destroyed by the Luftwaffe, that his old girlfriend had married someone else, that tea and beer and almost everything else were being rationed, so he COULDN’T easily enjoy the pleasures he’d been dreaming about.
Tolkien himself had suffered from severe post-traumatic stress after World War 1. For a long time, he felt he could NEVER live an ordinary, happy life again. Eventually, he DID marry, he ahd a successful career in academiz, and had a fairly happy life. But Tolkien understood all too well why many veterans could never be happy again, just as Frodo couldn’t.