The Mental Knight
Utter masterpiece of storytelling you need to deserve to experience. The game tells vastly different story depending on how deep you are willing to dig, and even the most shallow layer of a puzzle won't reveal itself until the final cutscene, leaving you in complete darkness during the entire first playthrough, hopelessly trying to decipher cryptic dialogs and lore pieces that don't make any sense to you... yet.
Then everything becomes crystal clear in less then 5 seconds. The story that can be spoiled in just one sentence, and a cause to everything that happens to Hallownest is a single, barely noticeable gesture happened countless generations of bugs ago, which resonated tremendously through the butterfly effect, leaving the formerly prospering kingdom in ruins.
How the fuck Team Cherry managed to convey a story this rich by means this scarce is a complete mistery to me. Nonetheless, I spent solid 28 hours finishing the game for the first time and far more than I wish to admit looking at other people's playthroughs, studying the lore, reading the wiki pages and various documents by community, examining fan theories and lore explanations by people who did commit into studying aspects of a game hidden from a regular player, and developing my own understanding of what happened there and how all of those completely unrelated storylines are connected to each other. It was a fascinating ride and now I am ready to put my own 5 cents to the hivemind.
I will not waste letters explaining everything as to someone completely unfamiliar with the lore, there are people who did much better job doing it than I ever will (even though I disagree with some of their points, those are not super important). And of course, nobody will tell the story better than Team Cherry did. So go play the game if you haven't already, it will worth your while.
What I will be telling you is my own speculation on the moral of the story, the ideas behind that, whether intentionally or not, caused authors to use terms and concepts we meet in the game. What each character or substantion met represents in my and only my opinion and what the whole story caused me to think of much closely than I previously would. Let's dig even deeper.
HIGHER BEINGS, THESE WORDS ARE FOR YOU ALONE
EVERYTHING WRITTEN BELOW MAY CONTAIN MAJOR, CRITICAL SPOILERS TO EVERYTHING IN THE GAME, INCLUDING ALL POSSIBLE ENDINGS
DO NOT PROCEED TO READ IF YOU DON'T WANT THEM FOR ANY REASON
During the playthrough, the game teaches us to operate 3 substances: void, soul and essence in two distinct realms: physical (the usual one, where all the physical stuff happens) and dream / nightmare (which can be consolidated under the word mental, the one related to contents of the mind that do not actually exist: fantasies, dreams, memories, thoughts, etc.)
While the realms nature is self-explanatory — we all separate things that do exist from things we only imagine in one way or another, what each substance is responsible for is not that clear.
The Soul, in all cultures and religions is an entity that grants living things whatever makes them alive. Which usually boils down to movement and power to create stuff (locally decrease entropy), using energy given. In regards to the game lore, soul represents power to cause, to change, to fulfill, to make stuff happen. Focus requires soul, any kind of magic requires soul, and almost any living creature leaks soul when used power on. Which is important wording, we will return to it shortly.
The Void is an exact opposite force to the soul. Void represents absence of things, the power to suppress, to dissolve, to contain. A black hole is a real life representation of void: whatever is absorbed by the void, becomes void itself. Void can be given form and focus, this way it is granted power to actively seek and abolish. The most important trait of void is purity: if there is something else inside the void, it is not void anymore, no matter how small and insignificant that something is. Nothing else to say, besides.
The Essence. An equivalent of the soul, but in regards to different realm. It grants power to access and operate mental stuff. To access mind, to read memories, thoughts, to invade and change things within mental realm. Even though we don't spend essence as we spend soul on each action, the purpose remains clear: the more essence we collect, the more power over everyone else's minds we obtain.
What's the infection even, then? Is it another substance? Well, this is where things get a bit complicated.
Infection
...For none could tame our savage souls yet you the challenge met, Under palest watch, you taught, we changed, base instincts were redeemed...
Monomon The Teacher
That piece of information is presented to us even before the first cutscene, right at the start of the game, but doesn't even get explained in base game: you need to reach well hidden optional location and learn about Pale King to even understand who Monomon addressed the words to. Which is somewhat cruel way to tell a story, not gonna lie.
Whatever.
The idea is, the Pale King is a powerful creature who found a way to grant bugs ability to think on their own and communicate with each other, opening the prosperity of building civilized society of various insects working together. Intelligence, in other words.
With power to think comes power to imagine, abstract thinking, hence mental realm emerges automatically. And with power to communicate, the mental worlds of different bugs become interconnected, causing a single, universal hivemind of Hallownest to thrive.
The Infection is represented by The Radiance, an entity that was either originated in, or found its way to said realm. It never appears in physical world, so it's safe to say it absolutely exists as a concept, but there is no eveidence it ever existed physically, so we just assume it didn't.
The infection is a mental illness, a harmful idea that makes you think in diseased way. A cancer that spreads through having close connections to infected person. What the game tries to tell us, is that with more power to think, comes more possibilities to think wrong, to end up with a broken mindset. And that harmful ideas are contagious, unless you possess enough willpower to combat them.
There is a reason why isolated (Mantis Tribe) and primitive (Deepnest) societies were not infected: they were not part of the Hallownest and had no personal connections to the Kingdom at all. Which sounds like anti-globalist propaganda but ok.
The Cure
As for the game endings, we are given two different solutions to the problem. The first one is the one Pale King himself came up with: simply, a quarantine. One selected (presumably, void, with a power to contain and bear the weight) creature preforms a sacrifice. A vessel absorbs all the infection and gets completely locked up and sealed, out of sight, out of mind.
Could it be seen as an allegory to one common way of treating harmful mindsets we actually use? For example, while we all hold desires and ideas deemed as harmful in our minds to some extent, we'd rather select a very few to blame and lock them away, in prison or mental facility, for example. The game shows this as a dead-end road, since story is going to repeat endlessly, whenever the vessel breaks, over and over.
The other solution is more difficult, but called a true ending in-game. We get into the mind of diseased person and through greater effort, eradicate the source of infection altogether. Which requires us to obtain a power not only to engage, but actually understand first (awoken dream nail), and then defeat not the vessel, but our true enemy, that does not even exist physically, hidden inside of it.
Which I think is an absolutely beautiful way to promote compassion.
Not very effective, sadly.