<snip>
You are right. Transactions are prioritized by fees, the discussion was about transactions which included the same output;
If address A signs a transaction of 0.1
BTC to B, and while it was yet unconfirmed; spent the same exact output in another transaction to C, with a much higher fee than the first transaction.
Miners may prioritize the first transaction regardless of the lower fee paid, while others would drop that and include the second (high fee) transaction, hence invalidating the first one.
In cases of different transactions involving different outputs, they are prioritized by the feerate (sats/byte).