If you've ever wondered where Bitcoin comes from and how it goes into circulation, the answer is that it gets "mined" into existence. Bitcoin mining serves to both add transactions to the block chain and to release new Bitcoin. The mining process involves compiling recent transactions into blocks and trying to solve a computationally difficult puzzle. The first participant who solves the puzzle gets to place the next block on the block chain and claim the rewards. The rewards incentivize mining and include both the transaction fees (paid to the miner in the form of Bitcoin) as well as the newly released Bitcoin.
During mining, your Bitcoin mining hardware runs a cryptographic hashing function (two rounds of SHA256) on what is called a block header. For each new hash that is tried, the mining software will use a different number as the random element of the block header, this number is called the nonce
Bitcoin mining is decentralized. Anyone with an internet connection and the proper hardware can participate. The security of the Bitcoin network depends on this decentralization since the Bitcoin network makes decisions based on consensus. If there is disagreement about whether a block should be included in the block chain, the decision is effectively made by a simple majority consensus, that is, if greater than half of the mining power agrees.
The amount of new bitcoin released with each mined block is called the block reward. The block reward is halved every 210,000 blocks, or roughly every four years. The block reward started at 50 bitcoin in 2009, and is now 25 bitcoin in 2014. This diminishing block reward will result in a total release of bitcoin that approaches 21 million. According to current Bitcoin protocol, 21 million is the cap and no more will be mined after that number has been attained.
How hard is it to mine Bitcoins? Well, that depends on how much effort is being put into mining across the network. Following the protocol laid out in the software, the Bitcoin network automatically adjusts the difficulty of the mining every 2016 blocks, or roughly every two weeks. It adjusts itself with the aim of keeping the rate of block discovery constant. Thus if more computational power is employed in mining, then the difficulty will adjust upwards to make mining harder.