Mining is intentionally designed to be resource-intensive and difficult so that the number of blocks found each day by miners remains steady. Individual blocks must contain a proof of work to be considered valid. This proof of work is verified by other Bitcoin nodes each time they receive a block. The primary purpose of mining is to allow Bitcoin computers or nodes to reach a secure, tamper-resistant consensus.
Mining is also the mechanism used to introduce new bitcoins into the system: a successful miner finding a new block is rewarded with newly created bitcoins and transaction fees. Currently, the reward amounts to 12.5 newly created bitcoins per block added to the blockchain. To claim the reward, a special transaction called a coinbase is included in the block with the processed payments. All bitcoins in existence have been created via coinbase transactions. The reason for this setup is to motivate people to provide security for the system. Miners need to spend energy to find those cryptographic solutions to new blocks of transactions.