There is a humanoid sentient species that gets stronger after recovering from life-threatening experiences. What kind of evolutionary pressures would lead to the evolution of this trait?
For clarification, in this universe there is a magical energy which can strengthen the body, like making bones harder to break, allowing muscles to lift more weight, and making skin harder to pierce. The process is mainly physiologically controlled, so you can't enter in a mood and increase the amount of this energy you receive a lot. Normally you can only gain it slowly, similarly to how you increase muscular mass by bodybuilding.