I think immunity has a mental aspect, aside from the physical.
The higher your mental immunity, the more psychologically resilient you are. The lower, the easier it becomes to cave in.
There is in fact a mental immunity threshold, where you break down mentally. It varies from person to person but it’s there.
Mental immunity, like everything valuable, works by accumulation – the more you sleep, exercise, laugh and feel good, the higher it goes. Philosophy and stoicism in particular help a lot, too. Meanwhile, the more stress you go trough, the lower your mental immunity goes.
Your goal is to keep it as much higher than your breaking point as possible. This way you won’t break down by any single bad event.
I can prove this theory – I almost lost my life by ignoring the reality of mental immunity.
There should be a way to check your mental immunity index.