The blockchain serves to confirm transactions to the rest of the network as having taken place. Bitcoin nodes use the blockchain to distinguish legitimate Bitcoin transactions from attempts to re-spend coins that have already been spent elsewhere.
So basically Mining is a mechanism used to introduce Bitcoins into the system: Miners are paid any transaction fees as well as a "subsidy" of newly created coins. This both serves the purpose of disseminating new coins in a decentralized manner and motivating people to provide security for the system.
Currently, mining is done using "mining rigs" a colloquial metaphor for a single computer system that performs the necessary computations for "mining".
Most commonly used mining hardware currently is ASIC or An application-specific integrated circuit, a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013. For the amount of power they consume, they are vastly faster and much profitable than all previous technologies such as GPUs and CPUs:
Mathematical explanation:
The number of blocks are calculated per 4 year cycles:
6 blocks per hour x 24 hours per day x 365 days per year x 4 years per cycle = 210,240 ~= 210,000
Sum of all the block reward sizes:
50 + 25 + 12.5 + 6.25 + 3.125 + ... = 100
Multiply the two:
210,000 x 100 = 21 million.
Check this out for details: Projected Bitcoins Long Term
Very interesting if you love mathematics
References:
1. https://en.bitcoin.it/wiki/Mining
2. https://en.bitcoin.it/wiki/Controlled_supply
3. https://bitcoin.stackexchange.com/questions/8439/why-was-21-million-picked-as-the-number-of-bitcoins-to-be-created