A 51% attack is when a miner or group of miners obtain 51% or more of the network hash power, allowing them to rewrite blockchain history. This attack is used for (among other things) a double-spend, where the attacker executes a transaction on the current blockchain (for example, to purchase goods), then rewrites the blockchain with different blocks that don't contain that transaction. Thereby, according to the rewritten blockchain, the attacker never spent those funds, making them free to spend again.
This attack has occurred on several public blockchain networks, including Bitcoin Gold, Ethereum Classic, and Horizen (which has since implemented a mitigation strategy).
One mitigation strategy is ChainLocks, implemented by the Dash network, in which (in simple terms) a majority quorum of nodes agree upon the state of the blockchain such that attacking blocks are rejected.