Danger is a fundamental aspect of the lives of most animals. Adaptive behavior therefore requires avoiding actions, objects, and environments associated with danger. Previous research has shown that humans and non-human animals can avoid such dangers through two types of behavioral adaptions, (i) genetic preparedness to avoid certain stimuli or actions, and (ii) social learning. These adaptive mechanisms reduce the fitness costs associated with danger but still allow flexible behavior. Despite the empirical prevalence and importance of both these mechanisms, it is unclear when they evolve and how they interact. We used evolutionary agent-based simulations, incorporating empirically based learning mechanisms, to clarify if preparedness and social learning typically both evolve in dangerous environments, and if these mechanisms generally interact synergistically or antagonistically. Our simulations showed that preparedness and social learning often co-evolve because they provide complimentary benefits: genetic preparedness reduced foraging efficiency, but resulted in a higher rate of survival in dangerous environments, while social learning generally came to dominate the population, especially when the environment was stochastic. However, even in this case, genetic preparedness reliably evolved. Broadly, our results indicate that the relationship between preparedness and social learning is important as it can result in trade-offs between behavioral flexibility and safety, which can lead to seemingly suboptimal behavior if the evolutionary environment of the organism is not taken into account.