Many bacteria require flagella for the ability to move, survive, and cause infection. The flagellum is a complex nanomachine that has evolved to increase the fitness of each bacterium to diverse environments. Over several decades, molecular, biochemical, and structural insights into the flagella have led to a comprehensive understanding of the structure and function of this fascinating nanomachine. Notably, X-ray crystallography, cryo-electron microscopy (cryo-EM), and cryo-electron tomography (cryo-ET) have elucidated the flagella and their components to unprecedented resolution, gleaning insights into their structural conservation and adaptation. In this review, we focus on recent structural studies that have led to a mechanistic understanding of flagellar assembly, function, and evolution.