The leading theory as to how such a strange behavior would evolve is that it springs from all organisms’ desire to conserve resources. If you can’t escape a source of stress, it leads to more stress, and this positive feedback loop eventually triggers an automatic shutdown. At its most extreme, you think if you keep struggling you might die. If you stop, there is a chance the bad thing will go away.