How Does a 51% Attack Executed via a Hashrate Rental Market Actually Work?
An attacker first rents a massive amount of hashrate from a marketplace, directing it to secretly mine a private version of the target coin's blockchain. While mining in secret, they spend their coins on the public chain, for instance by depositing them to an exchange and trading them for another cryptocurrency.
Once the exchange confirms the transaction, the attacker releases their secretly mined, now longer, blockchain to the network. The network's consensus rules accept the longest chain as valid, thus erasing the original transaction and allowing the attacker to spend the same coins again.