DATA PREV HASH SHA 0000000… Miners take part in a lottery by calculating hashes for a block with transactions, trying to make the SHA256-checksum to have N zeros as the prefix. You can add a prize for the miner in the transaction to incentivize including your transaction to the block and additionally miner can add a special transaction to the data block generating stuff from thin air. Clients listen for broadcasts for new calculated blocks and add them to the end of their list.