|Mining is a part of coming to a consensus on a blockchain that uses the Proof-of-Work method to agree on the order of transactions.|
A miner records every transaction that happens on the blockchain. Two different miners might have different versions of the transaction history. Every miner writes everything she recorded on the blockchain in a block. Since there are many miners on a blockchain, there are many different versions for the same block. They differ in the exact order of transactions.
All the miners have to solve a difficult computation that requires a lot of processing power. The miner who solves the problem first gets to add her block to the blockchain. The winning miner’s opinion will become the truth accepted by everybody else on the network, based on her solving the computation first.