To add: in addition to fees being used to thwart spam, EIP-1559 introduced a mechanism where these fees (not the block reward of course) are burned. One way to think of it is almost like a "stock buyback" from the Ethereum network: by reducing the supply, your ETH is worth more.
Thus, between EIP-1559 (burns base fees) and The Merge's move to Proof of Stake (a dramatically reduced block reward), there's very little net-new ETH being introduced into the system.
Check out: https://ultrasound.money
The fees are to mitigate spam attacks. You can only fit that many transactions in a block. Fees are bids to be included in a block. The higher the fee, the earlier your transaction gets included. Fees on Ethereum are high, because a lot of people want to use it.