in order to be on top of the big transaction, the front-runner would use more gas allocation than that big transaction. if you add even 1 wei over a trx you would be able to jump on top of it in the block index count. the gas is a multiplication of the gasPrice and gasAmount, so if gasPrice is the same but gasAmout is higher the gas is higher. so that's how it is done.
Just for info, there are multiple ways being implemented to circumvent front running transactions like personalized miner networks like flashbot's network which tries to directly talk to inner nodes in order to preferably mine transactions without relying on the automatic positioning system of eth.
There is also the "The Gas Station Network" which tried to abstract the notion of gas being paid via normal eth means so technically you can pay the miner node fiat or other tokens instead of regular gas which can result in front running bots confusion.