At the core of Bitcoin is a cryptographically secured blockchain – a ledger of all transactions made – which is decentralised and can be verified by any participating computer on the Bitcoin network.
These participants are given mathematical challenges to solve, to help in verifying existing transactions and add ‘blocks’ of new transactions onto the existing ‘chain’. In return, the most helpful participants – the most powerful computers or groups of computers, but not always – are automatically awarded Bitcoin.
There can be two ways of ‘mining’ for coins. Those who verified transactions are awarded fewer but existing coins as transaction fees. Those who ‘discovered’ a new block are awarded more but in new coins. In fact, this is how new coins are born — with the help of miners. After discovery, they then begin circulating.
The limited supply of Bitcoin means that eventually, there would be no ‘new’ coins to mine for. At that point, miners would still be needed but they will be limited to earning only transaction fees, which are obtained by by processing transactions made by others.
This is also why mining is sometimes seen as a necessary evil, despite the excess power consumption and chip shortages it is perceived to cause.