A 51% attack allows an attacker to control the majority of the network's computing power, enabling them to rewrite transaction history, double-spend, and exclude legitimate transactions. This threat can undermine the trust in a blockchain network and harm its reputation. To prevent 51% attacks, blockchains must have a significant and diverse distribution of mining power and continuously update their security measures.