Bacterial Flagellum
An approach to the evolutionary origin of the bacterial flagellum is suggested by the fact that a subset of flagellar components is similar to the Type III secretory and transport system.
All currently known nonflagellar Type III transport systems serve the function of injecting toxin into eukaryotic cells. It is hypothesised that the flagellum evolved from the type three secretory system. For example, the bubonic plague bacterium Yersinia pestis has an organelle assembly very similar to a complex flagellum, except that is missing only a few flagellar mechanisms and functions, such as a needle to inject toxins into other cells. It is also a possibility that the flagellum could have evolved from a currently undiscovered system with similar flagellar traits or a currently extinct organelle/organism. As such, the type three secretory system supports the hypothesis that the flagellum evolved from a simpler bacterial secretion system.
Read more about this topic: Evolution Of Flagella