The main purpose of mining is to allow BTC nodes to reach a secure, tamper-resistant consensus. Mining is also the mechanism used to introduce bitcoins into the system. Miners are paid transaction fees as well as a subsidy of newly created coins, named block rewards. This both serves the purpose of disseminating new coins in a decentralized manner as well as motivating people to provide security for the system through mining.
Thank you for this useful post