Simply a trustless consensus process of maintaining the blockchain, verifying transaction, and issuing new currency, in short becoming a bank. The process is also called mining because the bank is rewarded with coins for the work.
The cost of mining are basically:
If these are free, then it’s a guarantee profit. However, do consider resting your computer sometimes.