Bitcoin mining uses the hashcash proof of work function;
Mining is a process of packing transactions in the data blocks and giving them a header.
This header is then matched by a Nonce
to get a Hash
. When the hash is found and accepted by Bitcoin network the miner is rewarded by Bitcoins, so that ideally miners compete.
Each header contains a hash from the previous block.