A 51% attack is a method of disrupting the consensus state of a blockchain, potentially tampering with transactions or re-ordering blocks. 51% attacks can occur when one or multiple entities control 51% of the mining hash power (in a Proof of Work network) or 51% of the token supply (in a Proof of Stake network).
Such attacks can occur through individual entities, such as a large stakeholder in a PoS network, or coordinated groups of entities, such as mining pools in a PoW network. During the time such an entity has over half of the hashpower or stake, it can reverse transactions, double spend, prevent some transactions from being included in blocks, produce all blocks, and prevent other entities from creating blocks. However, the attacker cannot enforce changes to the protocol codebase, change block rewards, or spend others's tokens.