Mining 

When a transaction is sent to the bitcoin network, it is not finalized until it gets included in a "block" of transactions by a "bitcoin miner." Being a miner isn't a reserved role, but an open position for anyone able to provide enough computing power to validate the transactions. All the time, the miners in the network are racing to be the first one to validate a block of transactions by performing a difficult computational operation to solve a function defined by the protocol (Proof of Work). The first miner to succeed is rewarded with a prize of newly generated bitcoins along with "transaction fees" paid for each transaction, as well as his blocks being included in the blockchain.

However, it should be noted that these mechanisms are susceptible to being reversed, hence the need to wait for a few confirmations (more than six blocks) to consider the transaction final.