I understand that, but it seems like even the MVP "shitty" flagellum would require many mutations that individually have no benefit. But I suppose with enough generations/parallelism you get enough stacking of useless mutations to reach the useful ones.
That's the thing most people have difficulty wrapping their head around. What you need to remember is it's not the structures evolving, it's the instructions evolving. If for example you have a small molecular pump that the cell uses to suck up sodium ions, and a mutation causes the part of the rotor sticking out of the cell to just be longer, which might be due to a single change to the gene controlling the length of the rotor, then congrats, you now have a shitty flagellum. The mutations don't even need to be useful for the eventual purpose. For example the highly dexterous fingers which enable complex tool use that humans used to conquer the world and with which I type this comment now started out as structural reinforcement for fish fins, absolutely useless for object manipulation. And those reinforcements in turn are just extremely bastardized version of a calcite growth which offered some protection to a soft body organism hundreds of millions of years before.
But again you're starting with a fairly complex system already, the molecular pump.
And my (limited) understanding is that changes that are not useful or helpful would get lost.
And additional to that, if an organism has a pump (which it needs to function properly) and that pump suddenly is no pump, it's a very bad flagellum, that organism has a very big problem. It's like if we swapped our arms for wings. Wings are cool, but we wouldn't be able to fly anyway, and we'd have serious problems as humans with no arms and hands.
> and that pump suddenly is no pump, it's a very bad flagellum, that organism has a very big problem
Cells has many duplicates of pumps, not just one. Switching one of those to a motor to move around the liquids so the pumps can get to new molecules to absorb will be extremely beneficial to the cell, now all pumps are more efficient at just the cost of a single pump.
> But again you're starting with a fairly complex system already, the molecular pump.
Yes, but it's less complex, and it in turn evolved from even simpler forms. The point is a single mutation doesn't need to create a working flagellum from scratch, it just needs to make it from what's already available. Flagella are complex structures that did not arise until after a lot of other things had already developed.
> And my (limited) understanding is that changes that are not useful or helpful would get lost.
This misunderstanding again comes from the distinction between the features and the instructions. If a mutation isn't harmful, it doesn't get reverted and in fact will spread throughout a sizeable fraction of the population. The thing is that without evolutionary pressure as more mutations occur, they will eventually break whatever the original mutation did, so the feature it coded will eventually disappear, though it can take a long time and it may change significantly before it does. There are some caveats though - a gene might code for multiple features, or may exist on a part of the DNA where further mutations are suppressed anyway, and thus even though the feature provides no advantage on its own there will still be evolutionary pressure to preserve the gene, and thus a neutral or even a slightly bad mutation might be retained indefinitely.
> And additional to that, if an organism has a pump (which it needs to function properly) and that pump suddenly is no pump, it's a very bad flagellum, that organism has a very big problem. It's like if we swapped our arms for wings. Wings are cool, but we wouldn't be able to fly anyway, and we'd have serious problems as humans with no arms and hands.
In this particular case, cells have many molecular pumps, so converting some to flagella is not a very big problem. The benefits of a shitty flagellum did outweigh the cost of losing some molecular pumps, but this is a very real limitation to what evolution can produce. Humans certainly won't evolve wings naturally without a lot of other changes happening first. But at the same time wings have evolved - in the case of birds their ancestors evolved an extremely efficient respiratory system more than 100 million years before they took flight, which helped them survive the great dying and subsequently take advantage of the oxygen rich Mesozoic era. Among these a mutation for hollow bones aided agility on the ground, among these adaptations for feathers helped with retaining body heat, among these adaptations for lunging their arms forward helped them grab prey, among these adaptations for tree climbing allowed them to become better ambushers, and it was among these that sacrificing some of their arm capabilities for shitty wings was a net gain.