The race attack is a particular kind of a double-spend attempt. It requires the recipient to accept payment for unconfirmed transactions.
The attacker sends the victim an unconfirmed transaction. Meanwhile, they broadcast to the network a conflicting transaction. Since the victim observed their own transaction first, they believe they will be paid. However, since the rest of the network saw the double-spend first, it’s likely that the victim will not get the money.
Such an attack is significantly easier to carry out when the attacker has a direct connection to the victim's node and deposits the conflicting transaction directly to the miners.
https://www.bitdegree.org/crypto/learn/crypto-terms/what-is-race-attack