Every Ethereum transaction pays a fee called gas. It is really two numbers multiplied together, how much work you do and the going price per unit of work, and once you separate those two, everything about Ethereum fees stops being mysterious.
Why gas exists at all
Ethereum executes programs, and programs can loop forever. Gas is the meter that prevents that: every operation the EVM performs (adding numbers, writing storage, calling a contract) has a fixed cost in gas units, and every transaction declares a limit it is willing to consume. Run out, and execution halts (state reverts, but the fee is still paid, because validators did the work).
Metering also makes block space a market. Blocks target 15 million gas, so gas units are the scarce resource, and the fee per unit is the price that rations it.
The two numbers: units × price
Gas units measure the work a transaction does. They are a property of the operation, not the market: a plain ETH transfer is 21,000 gas today, tomorrow, and during a bull run. Rough anchors:
The price: base fee + priority fee
The price per gas unit is quoted in gwei and, since EIP-1559, splits into two parts. The base fee is computed by the protocol itself from how full recent blocks were: above the 15M-gas target it rises up to 12.5% per block, below target it falls. Nobody collects it: it is burned. The priority fee ("tip") is the small extra you offer the block proposer to include you promptly, typically 1-2 gwei in calm conditions, more when everyone wants the same block.
Your total cost: gas units × (base fee + priority fee). Worked example: an ERC-20 transfer of 65,000 gas at a 10 gwei base fee plus a 1 gwei tip costs 65,000 × 11 gwei = 715,000 gwei = 0.000715 ETH, about $2.15 if ETH is $3,000. The gas tracker runs this exact multiplication against live numbers.
Why fees spike
Block space is fixed; demand is not. A hyped mint, an airdrop claim, a market crash triggering liquidations: anything that makes thousands of people want the same few blocks pushes the base fee up 12.5% per block until demand relents. That compounding is fast: twenty consecutive full blocks (four minutes) can multiply the base fee by ten.
The flip side: spikes decay just as mechanically once blocks run under target. If a fee looks absurd and your transaction is not urgent, waiting an hour is often the single most effective gas optimization available.
What about L2s?
Rollups like Base, Arbitrum, and Optimism run the same EVM with the same gas-unit accounting, but their execution gas clears at tiny prices, fractions of a gwei, because block space there is abundant. They add a second component instead: an L1 data fee for publishing the transaction's data to Ethereum, which the L2 prices automatically. Since EIP-4844 introduced blob space, that data component has been small most of the time, which is why an L2 swap often costs cents rather than dollars.
Practical rules of thumb
Check the base fee before signing anything expensive; it moves in minutes, not seconds. Set a generous maxFeePerGas and a modest tip; you are refunded the unused difference, so the cap is protection, not a bid. And remember that failed transactions still pay: the network charges for computation performed, not for outcomes achieved.