Let's say you're an institutional investor with an obligation to maintain a particular investment profile, and there's some event that forces you to rebalance your portfolio in a fairly dramatic way. You're used to working with stable portfolios with more or less predictable returns, and this might be a bit much for you to take on, so you decide to blow some of your management fee on some really smart consultants who can do the rebalance for you. They, in turn, have to figure out how to actually execute the plan that they come up with - there are going to be some pretty big orders involved, and if the market gets tipped off that this is going to happen, people are going to start hoarding their shares to drive the price up to screw you. So they start chopping the order up into much smaller orders and dribbling them out slowly, or looking for baskets of stocks that act like the stocks you really want, or trying to fill from dark pools, all kinds of crazy tricks (and they have to do the same kind of things on the sell side to finance all this).
Meanwhile, some even smarter guys at an investment bank just down the road know all these tricks, too, and have come up with a way to algorithmically spot them happening more accurately or more quickly than anyone else. So they start jumping in front of your trades, not because they want the stock, but because they know you want it and are probably willing to chase a rising bid for a while. Then all the other algorithms start to notice, and they start doing the same thing.
You, the friendly investment manager, are now financing both sides of what really amounts to one of the coolest deathmatches going, a bunch of math and computer geeks playing on your quarter and keeping a penny for the honor of letting you watch them do it. But you actually don't care, because it wasn't your quarter in the first place, and now that your fund is back in order, you're not going to get sued, and your customers, who had no idea that any of this was going on, and who may not even realize they're your customers, are back to paying 2% fees for (statistically likely) below-market returns.
In the past, these kinds of large trades would usually end up splitting the difference, with 'real' sellers earning a bit more than what they would have otherwise settled for and 'real' buyers paying a bit less than their actual ceiling. But now 'real' buyers end up paying close to their high bid, and 'real' sellers end up earning their low ask, with the bots fighting it out for the very thinly sliced middle territory.
In one sense, I do agree that this is an example of a market working perfectly. Algorithmic traders are exploiting an arbitrage opportunity between mainstream industry practice and cutting edge technical ability, and just like theory would suggest, they're making bank from it.