Mining of bitcoins is the type of process by which valid blocks are created that add transaction records to Bitcoins public ledger which is known as the blockchain. This is a very important and crucial component of the bitcoin network, as this solves the so-called “double-spend problem”.
The double-spend problem is the issue of needing to search for a consensus on a history of all the transactions. The ownership of people on bitcoins can be proved mathematically by the public key cryptography that cannot be broken with present-day technology. However, cryptography cannot alone guarantee you that a particular coin had not previously been sent to some other person. In order, if you want to form a shared history of transactions, then you are required to have an agreed-upon ordering which is based on for eg. The time at which each transaction is created. But any kind of external input can be easily manipulated by who so ever provides that, which requires participants to trust the third party.
Bitcoin mining actually leverages economic incentives in order to provide a trustworthy way of ordering data. The ordering transaction of the third party is decentralized and they can receive some of the monetary rewards for their correct behaviour. On the contrary to this thing, any misbehavior will ultimately result in the loss of economic resources at least as long as the majority of the people remain honest.
In the case of mining of bitcoins, the results are gained by creating a succession of blocks that can be mathematically proven to have been stacked in the correct manner along with a certain commitment of the resources. This process basically hinges so the mathematical properties of a cryptographic hash which is a way to encode any of the data in a standardized manner.