You probably know that the miners collect all the fees in a block. So it is in miner's best interest to cram as many high fee transactions in a block as he can. The transaction size depends on the number of UTXOs used in the transaction (and in the size of the script, if you are doing something more complicated than simply sending money). So the fees on the blockchain depend on the size of the transaction, and since the size of each block is limited, people compete to have their transactions put their (verified as per bitcoin terminology) and so the transaction fees rise with that. (Keep in mind that this wasn't always the case. When the demand was low in the past you can see very cheep on-chain transactions, but this will probably never happen again.)
When you talk about L2 I suppose you are talking only about lightning (as this is what I will explain). Lightning network is made of so-called lightning channels between peers. Due to combination of locking funds and some cryptography, these are not IOUs. Everybody in the lightning network can unlock and his part of the money without any cooperation from his channel partner. The fees there are usually related to the actual amount being passed (like a percentage, in my limited experience something like 0.3% fee). The limiting factor there is something called liquidity and in short, the node operators don't want money flowing only in a single direction. They can also control this by setting appropriate fees to encourage some routes over others.