Think of the "freeze" response that, say, deer have when they get caught by a leopard. It would be best for the deer (and its family i.e. those with similar genes) if it didn't have a freeze response. It would be much better for them if they had a "fight till death" response. That way, every time a leopard caught a deer, it would get most likely get injured and leopards would be able to hunt fewer deer.
The deer has a freeze response because it has nothing to do with what's good for the deer and everything to do with what is good for the ecosystem. It's best if it outruns the leopard... but if it gets caught, it's best if it freezes while the leopard kills it.
P.S. The mainstream explanation of the freeze response is that "it helps the deer deal with the pain". However, they fail to explain what the evolutionary benefit to not feeling pain as one is being eaten is.