Some blockchains use a process called mining to decide who should have the right to propose the next block and earn rewards for doing so. To make it fair, crypto mining is designed as a sort of competition that repeats every few minutes (this time varies depending on the specific blockchain).
The competition requires participants, known as “miners”, to use specialized machines to generate random, fixed-length codes — almost like digital lottery tickets. Miners compete to generate a code that has the same or more zeroes at the front than the target hash (the code that everyone tries to beat).
Not only does this process fairly select people at random to propose new blocks, but the energy involved in this challenge helps to secure the blockchain network itself.