Martensites are materials that undergo diffusionless, solid-state transitions. The martensitic transition yields properties that depend on the history of the material and may allow it to recover its previous shape after plastic deformation. This is known as the shape-memory effect (SME). We have succeeded in identifying the primary electronic mechanism responsible for the martensitic transition in the shape-memory alloy AuZn by using Fermi-surface measurements (de Haas-van Alphen oscillations) and band-structure calculations. This strongly suggests that electronic band structure is an important consideration in the design of future SME alloys.