Plants commonly produce families of structurally related metabolites with similar defensive functions. This apparent redundancy raises the question of underlying molecular mechanisms and adaptive benefits of such chemical variation. Cardenolides, a class defensive compounds found in the wallflower genusErysimum(L., Brassicaceae) and scattered across other plant families, show substantial structural variation, with glycosylation and hydroxylation being common modifications of a steroid core, which itself may vary in terms of stereochemistry and saturation. Through a combination of chemical mutagenesis and analysis of gene coexpression networks, we identified four enzymes involved in cardenolide biosynthesis inErysimumthat work together to determine stereochemistry at carbon 5 of the steroid core: Ec3βHSD, a 3β-hydroxysteroid dehydrogenase, Ec3KSI, a ketosteroid isomerase, EcP5βR2, a progesterone 5β-reductase, and EcDET2, a steroid 5α-reductase. We biochemically characterized the activity of these enzymes in vitro and generated CRISPR/Cas9 knockout lines to confirm activity in vivo. Cardenolide biosynthesis was not eliminated in any of the knockouts. Instead, mutant plants accumulated cardenolides with altered saturation and stereochemistry of the steroid core. Furthermore, we found variation in carbon 5 configuration among the cardenolides of 44 species ofErysimum, where the occurrence of some 5β-cardenolides is associated with the expression and sequence of P5βR2. This may have allowedErysimumspecies to fine-tune their defensive profiles to target specific herbivore populations over the course of evolution.