Bitcoin mining is complex, and yet very simple. You can learn more about how bitcoin mining works right here. Bitcoin mining is the process that processes transactions on the bitcoin blockchain, and creates new blocks. It is generally done by specialized machines, called ASIC miners.
These specialized computers are very good at solving the math puzzles that allow new blocks to be added to the bitcoin blockchain. When blocks are added by mining nodes, transactions on the platform are completed, and the ownership of the private keys that control bitcoin move from one wallet to another.
In order for a transaction to be recognized, most services require that at least 3 or more nodes approve the changes. The miners who make the network operate are rewarded with bitcoins for doing the job.
This is one of the reasons why bitcoin's blockchain isn't a great solution for retail payments, and why it takes much longer to complete a transaction than a token like Ripple, which operates without a blockchain.
Every so often the difficulty of the math puzzles that the bitcoin network uses to add blocks doubles in difficulty, and this is called a 'halving'. Bitcoin will be mineable until the early part of next century, as long as things remain more or less consistent in terms of popularity and computing power.