It can sometimes work that way, but there's no guarantee. If the buyer meets the sellers price, there's no one in between - the deal is done. But the moment that happens, the market is back to normal, with a gap between buyer and seller.
If the highest current outstanding bid (WTB) is $100, and the highest current outstanding ask (WTS) is $104, how's the bot going to make money - buy at 104 and sell at 100? No. The bot makes money when someone wants to sell "at market" the bot buys at 101, and the seller makes $1 more. Later, if the price hasn't moved, and someone is buying "at market", the bot may sell at 103, and the buyer saves $1.
Do you understand how this works? And why it's risky? If there's only 1 bot, it is reasonably safe, but it benefits both buyer and seller, so why complain. But there's usually more than one bot racing each other, so it's more like buy at 101.95 and sell at 102.05, which is great for the casual, small-time guy like me. I remember how it was last century, and it sucked.