Is generated by the built-in algorithm, by running the bitcoin algorithm, the computer generates a specific number, you can get 25 bitcoin. Bitcoin's algorithm determines that unit operations yield only a fixed number of bitcoin, and that the current rate is 25 bitcoin for 10 minutes. This speed has nothing to do with the overall performance of the machines involved in bitcoin operations, but the more computationally efficient machines in the bitcoin network can dig into more mines - the bitcoin that comes out of the box is newer and who's better Grab more.
Sorry, but this answer is wrong on so many levels. I started correcting the post, but i had to give up, since after striking trough most of the errors, not much was left.
Basically, the newbie explanation of mining: a miner collects unconfirmed transactions, he verifies these transactions and he verifies all broadcasted blocks.
He then tries to combine these unconfirmed transactions into a block that has a maximum size of 1 Mb (disregarding the witness data, a block can be 4 Mb including the witness data). The first transaction in the block is the coinbase transaction, the coinbase transaction rewards the miner with 12.5 BTC and the sum of the fees of all transactions in the block. Every 210,000 blocks, the block reward of 12.5 BTC halves.
He then creates a merkle tree of the subset of transaction that forms his block
He then combines header information of the previous block, the merkle root, some other information and a nonce to form his new block's header. He then creates the sha256 hash of the sha256 hash of this header. If the outcome of the hash function is under the current target, his block is valid and he can broadcast his block.
If the outcome of the hashfunction is not under the current target, he increments the nonce and retries the hash function, just as long untill he finds a block header (including the nonce) whose outcome of the sha256d function is under target.
The difficulty makes sure that the target is so small that the average time between 2 blocks is 10 minutes. The difficulty gets adjusted every 2016 blocks.
@op:
The current difficulty is so high (and the target so low), it would take a massive amount of ASIC's to have a decent shot of finding a block header whose sha256d hash is under the current target, so people started forming pools. They pool their hashrate together to have a better shot at solving a block's header. Like other members already said: you joined a pool, you were pooling your hashrate together with other people... So when your pool found a block, you got rewarded a tiny piece of the total block reward.