The bacterial flagellum is a complex and dynamic nanomachine that propels bacteria through liquids. It consists of a basal body, a hook, and a long filament. The flagellar filament is composed of thousands of copies of the protein flagellin (FliC) arranged helically and ending with a filament cap composed of an oligomer of the protein FliD. The overall structure of the filament core is preserved across bacterial species, while the outer domains exhibit high variability, and in some cases are even completely absent. Flagellar assembly is a complex and energetically costly process triggered by environmental stimuli and, accordingly, highly regulated on transcriptional, translational and post-translational levels. Apart from its role in locomotion, the filament is critically important in several other aspects of bacterial survival, reproduction and pathogenicity, such as adhesion to surfaces, secretion of virulence factors and formation of biofilms. Additionally, due to its ability to provoke potent immune responses, flagellins have a role as adjuvants in vaccine development.