Ecological context shapes the response of consumers to predation risk