Mining is behind the blockchain. Mining supports the Trustlessness of Blockchain to execute the transaction or any action for that matter. It has to be there till the blockchain is. Bitcoin / Crypto dies if the mining dies.
There is lot to know about mining. There are lot of types of mining depending on proof of Work or Stake or Asset or Storage or many other type. All this is mining done to identify the correctness of Block Transaction.