Gas Fee is a fee that needs to be paid to network validators when a blockchain user executes a transaction, and these fees are typically paid in the form of native assets to the blockchain network.
Gas Fee was originally designed to compensate network validators for the energy costs of validating transactions, and to provide a layer of security to the blockchain network itself - making it more expensive for users to send spam transactions maliciously.
The term Gas was originally invented by Ethereum. According to the Ethereum developer page, "Gas is essential to the Ethereum network. It is the fuel that allows it to operate, in the same way, that a car needs gasoline to run."
Some of the other blockchain networks follow the Gas Fee name (e.g. Polygon, BNB Chain, etc.). Some may call these transaction fees, miner fees, or other similar fees (e.g. Bitcoin, Litecoin, etc.), but they are essentially fees paid by users to network validators in order to execute transactions.
Different networks have different ways of calculating Gas Fee, let's take Ethernet as an example: Total Fee = Gas limit * (Base fee + Priority fee)

Please Note: The above calculation method is the current calculation method after the London Upgrade of Ethereum in August 2021. To understand the calculation method before the London upgrade, please refer to EIP-1559.

Assuming we set the Gas Limit to 50,000 to execute an $ETH transfer transaction, the validator will consume 21,000 Units of Gas and the remaining 29,000 will be returned.
Suppose we set the Gas Limit to 20,000, the network validator will still consume 20,000 Units of Gas in an attempt to complete the transaction, but the transaction will not be confirmed because there are not enough Gas Units. However, since the validator has already completed 20,000 Gas Units worth of work, the 20,000 Units of Gas will be consumed and not returned.
When trading in Ethereum and paying Gas Fee, we often see the word “Gwei” as the unit of Gas Fee. What is Gwei?
When designing Ethereum, $ETH was designed to be split into a minimum of 1,000,000,000,000,000,000 pieces (18 zeros), and for ease of calculation, the minimum split unit was set to the unit of measure “wei”. Later, since Gas Fee is usually much less than 1 $ETH, “Gwei” (gigawei) was set to represent the unit of measure for Gas Fee. giga means gigabyte (like gigabyte-GB), and 1 $ETH = 1,000,000,000 Gwei (9 zeros)