Participants are known as miners (or ‘mining nodes’) and they compete with each other to be the node that solves the puzzle. Whilst doing so they also validate the transactions contained in the latest block.
The first miner to complete the task submits the block to the network. Then, assuming it gains the consensus of the other nodes, the block is added to the end of the blockchain, and so the chain continues.
The successful miner receives a reward in the form of both the transaction fees for that block and some additional cryptocurrency (bitcoin in the case of the bitcoin blockchain).
This computational work consumes a huge amount of electricity. This means that, as well as producing information, significant amounts of heat are generated. The need to invest in powerful, cooled ‘mining rigs’ (often collected into larger mining pools) to cope with the demands of the work, along with the cost of the electricity used, ensure participants are motivated to play by the rules.
If they don’t, the rest of the network will simply fail to meet consensus and the block will be rejected.