Steroidal alkaloids play a crucial role in plant defense and exhibit distinct stereochemistry at C25, forming either the tomato-type (25S) or eggplant-type (25R) isomers. Here, we uncover the molecular mechanisms shaping this stereochemical diversity. Phylogenetic analysis of GLYCOALKALOID METABOLISM 8 (GAME8) cytochrome P450 hydroxylases across the Solanaceae family revealed two distinct clades producing either 25S or 25R isomers. Ancestral GAME8 likely favored 25R, with gene duplications giving rise to 25S-producing enzymes in more recent Solanum species. In S. nigrum and S. dulcamara, multiple GAME8 copies generate mixed isomeric profiles. Notably, in wild S. cheesmaniae from the Galápagos, mutations in GAME8 have driven a shift from 25S back to the ancestral 25R, suggesting reverse evolution. Our findings highlight how GAME8 evolution has shaped alkaloid diversity in the genus Solanum, demonstrating a complex interplay between enzyme function, genetic variation, and evolutionary adaptation.