When looking to perform a transaction on Ethereum, there is a fee, and this fee is measured in Gas. Gas is therefore the cost required to successfully conduct a transaction or execute a contract on the Ethereum blockchain.
Because all operations on Ethereum operate as transactions, these transactions need to come with a fee as part of the Ethereum operations. Small fractions of Ether, often called Gwei, are paid as the gas fees in order to enact these transactions.
Under the hood, what is actually happening is that these small fractional costs are going towards fuelling the Ethereum Virtual Machine (EVM) Gas powers this machine which allows for applications on Ethereum to function, most notably smart contracts, so that they can self execute in a decentralized manner.
Gas was introduced to Ethereum especially to help the blockchain have two distinct value layers. There is a separation between the cost and value of the underlying cryptocurrency, Ether, and Gas with its varying prices. Having a separate pricing mechanism for computational costs keeps the price of operating Ethereum away from the value of the currency.
Essentially the payment of gas is done by users to compensate for the energy used when processing and validating transactions on the Ethereum chain. The word gas, as in gasoline for a vehicle, is a good analogy for Ethereum Gas as you need it in order to make the chain work.
"Gas limit" refers to the maximum amount of gas (or energy) that you're willing to spend on a particular transaction. A higher gas limit means that you must do more work to execute a transaction using ETH or a smart contract.
Having gas means that miners of the chin, who are the ones validating and processing transactions, are compensated and incentivised to maintain and solidify the network. Miners are rewarded for doing their job from the gas fees attached to transactions, but the varying offering of gas prices means miners can prioritize the ones that will reward them more.
##Understanding the EVM
Ethereum's key selling point is its powerful smart contracts that allow for decentralized agreements to take place between parties. These smart contracts can be used in real world examples without the need for intermediaries and centralized figures.
These smart contracts are driven by the EVM which is the mechanism that ensures the smart contract ecosystem works and executes effectively. However, to ensure the EVM runs correctly, gas and the payment of miners that validate and verify transactions helps maintain the EVM and keeps it running correctly.