Proof of work (POW) is a decentralized consensus algorithm that blockchains utilize to deter attacks and ensure that transactions are legitimate.
Proof of work allows for a trustless and distributed consensus, which means that users do not have to rely on third-party services for transactions. In order to create new groups of trustless transactions on the blockchain(s), a complex computer calculation called ‘mining’ must occur. These transactions are packed into blocks to be processed by miners.
This not only verifies the legitimacy of transactions, but also helps create new crypto assets and digital rewards for miners. This group of people must compete to solve a mathematical puzzle and find the value of the ‘nonce’, as the first one that does so will be rewarded. A nonce is what changes block contents, with a new valid hash being generated every x minutes.
All of these elements are in the ‘blocks’ of a blockchain. Miners must have powerful computers with a lot of processing power, which may lead to some electricity and energy wastage.

This is why it is difficult to make any alterations to a proof of work system. Another one of the main benefits of proof of work is that hackers may find it quite difficult to launch attacks, as they will need to have computers or software more powerful than 51% of the network.