Sandwiching occurs by placing one order before the transaction and another immediately after, which ensures that retail always gets the worst possible price.

Solana, Sandwich Attack, Validator Removal, Solana Delegation, Crypto SecurityRead More

You might also be interested in reading Attacker drains $800K from DeFi protocol Sturdy Finance.