To put it as simply as possible, tons of computers all over the world are all running calculations attempting to guess the next “block” that contains a reward plus transaction fees. This happens roughly every 10. The more hashing power (energy) you put into the network, the better your chances at being the one that guesses the next block. Every 4 years, that reward is halved until there are no bitcoin left.