It is well‐known that prey species often face trade‐offs between defense against predation and competitiveness, enabling predator‐mediated coexistence. However, we lack an understanding of how the large variety of different defense traits with different competition costs affects coexistence and population dynamics. Our study focusses on two general defense mechanisms, that is, pre‐attack (e.g., camouflage) and post‐attack defenses (e.g., weaponry) that act at different phases of the predator—prey interaction. We consider a food web model with one predator, two prey types and one resource. One prey type is undefended, while the other one is pre‐ or post‐attack defended paying costs either by a higher half‐saturation constant for resource uptake or a lower maximum growth rate. We show that post‐attack defenses promote prey coexistence and stabilize the population dynamics more strongly than pre‐attack defenses by interfering with the predator's functional response: Because the predator spends time handling “noncrackable” prey, the undefended prey is indirectly facilitated. A high half‐saturation constant as defense costs promotes coexistence more and stabilizes the dynamics less than a low maximum growth rate. The former imposes high costs at low resource concentrations but allows for temporally high growth rates at predator‐induced resource peaks preventing the extinction of the defended prey. We evaluate the effects of the different defense mechanisms and costs on coexistence under different enrichment levels in order to vary the importance of bottom‐up and top‐down control of the prey community.