What is a 51% attack?
If one party controls more than half of the network's mining power (or stake), it can build the longest chain at will and force the network to accept its version of history.
Because honest nodes follow the longest valid chain, whoever can produce blocks faster than everyone else combined controls which chain becomes canonical. With majority power, an attacker can mine a private chain, then release it once it is longer than the public one, causing the network to reorganize onto it — enabling, for example, reversing their own recent transactions (a double-spend). Crucially they cannot steal others' coins or forge signatures, but they can rewrite recent history and censor transactions. The defence is scale and cost: on a large chain, acquiring a majority of the hash power or stake is astronomically expensive, and the bigger and more decentralized the network grows, the more secure it becomes. Smaller chains (this has happened to Ethereum Classic, which is distinct from Ethereum) are more vulnerable precisely because a majority is cheaper to buy.
Go deeper:
Double-spending — Wikipedia — the "51% attack" section, with real cases on smaller chains.