What exactly happens in a 51% attack?
An attacker is able to reverse any transaction, given enough time, or deem the network non-operational by mining empty blocks, if he owns the majority of the hashrate that is used for mining, hence "51% attack".
Read more in here:
https://learnmeabitcoin.com/technical/blockchain/51-attack/.