Bitcoin Mining is the process that maintains the bitcoin network and also how new coins are brought into existence.
All transactions are publicly broadcast on the network and miners bundle large collections of transactions together into blocks by completing a cryptographic calculation that’s extremely hard to generate but very easy to verify. The first miner to solve the next block broadcasts it to the network and if proven correct is added to the blockchain. That miner is then rewarded with an amount of newly created bitcoin.
Inherent in the bitcoin software is a hard limit of 21 million coins. There will never be more than that in existence. The total number of coins will be in circulation by 2140. Roughly every four years the software makes it twice as hard to mine bitcoin by reducing the size of the rewards.
When Bitcoin was first launched it was possible to almost instantaneously mine a coin using even a basic computer. Now it requires rooms full of powerful equipment, often high-end graphics cards that are adept at crunching through the calculations, which when combined with a volatile bitcoin price can sometimes make mining more expensive than it is worth.
Miners also choose which transactions to bundle into a block, so fees of a varying amount are added by the sender as an incentive. Once all coins have been mined, these fees will continue as an incentive for mining to continue. This is needed as it provides the infrastructure of the Bitcoin network.