Just like you need gas to get a car moving, gas fees are what you pay to miners or validators to verify and record transactions or to run smart contracts on the blockchain.
These fees go to validators as compensation for the computational work required to perform these actions.
Here is another article you might like 😊 What Is A Market Price?