Flagella are helical appendages made of the protein flagellin, crucial for bacterial motility and host attachment. They vary in arrangement (monotrichous, lophotrichous, amphitrichous, peritrichous) and structure, with differences between gram-positive and gram-negative bacteria affecting their basal body composition. Bacteria move by rotating their flagella, with the direction of rotation determining their movement patterns, such as 'runs' and 'tumbles'.