What is Gas Limit
The gas limit is the maximum amount of gas an Ethereum user would spend to conduct a transaction or contract on the Ethereum blockchain. It depends on the speed demanded to fulfill the transaction or its difficulty.
The gas limit can be automatically calculated or manually set by the user. The minimum gas limit is 21,000 units of gas. For faster or more complex transactions, higher fees are set because they consume more gas. Miners can choose which transactions to validate based on the gas price and gas limit, according to their standards.
A user should properly estimate how much computational power the transaction is likely to consume. If the gas price limit is set too low, the user risks the consumption of gas without the completion of the required transaction. Therefore, the transaction would be marked "failed", and the user would not be refunded. If the Ethereum user sets a gas limit higher than what the operation requires, and as a result, a smaller amount of gas is consumed compared to the limit the user has set, the unused Ether will be returned to the wallet.
Gas fees and gas limits exist to protect the network users from bad actors and to avert waste of computational power.