What is gas in a blockchain?

In plain words
Gas is the fee for the network to carry out your operation, whether that is a transfer, a swap, or an action of a smart contract. The name caught on by analogy. Just as a car needs gasoline to drive, an operation needs gas for the network to process it.
You pay it not to an exchange and not to a website, but to the network itself, more precisely to those who keep it running. That is why gas exists even when you are simply sending coins from your own wallet.
Keep one thing in mind from the very start. To send a token, the wallet must also hold the coin of the network itself, specifically for gas. A common beginner mistake looks like this: the tokens are on the wallet, but there is no network coin for gas, and the transfer does not go through.
Deeper
Why the size of gas jumps around
Gas is not fixed. It depends on two things. The first is how heavy the operation itself is. A simple transfer is cheaper, while a complex action in a smart contract is more expensive. The second is how loaded the network is right now. When everyone is active at once, gas is more expensive, like a taxi at rush hour.
That is why a single Ethereum fee does not exist, and we do not write the exact amount into the reference, you look it up in a network explorer.
Gas comes in different kinds
The word gas itself came from the world of Ethereum and networks like it. In other networks the fee for operations is arranged and named differently. On Bitcoin it is simply a transfer fee, and some networks have their own particulars. But the general principle is the same everywhere, you pay for the network’s work.
Here is an important detail: gas is usually paid in the coin of the network itself, on Ethereum that is ETH, not in the token you are sending. That is exactly why the nothing to pay gas with error comes up, when the wallet has the token but no network coin for the fee. There is a caveat too: that is how it works by default, but not always. Newer mechanisms, for example account abstraction and so-called paymasters, that is, fee sponsors, let some wallets and apps pay gas in another token or shift it onto a service, which is called gas sponsorship. So the rule you need the network’s coin holds by default, but exceptions do occur.
Gas: the practical takeaway
Before sending, keep a little of the network’s own coin on the wallet specifically for gas: for example, ETH for Ethereum, TRX for Tron, SOL for Solana. If the operation is not urgent, it is cheaper to do it when the network is less busy. How the sending itself works, that is, choosing the network and the address, is covered in the article how to send crypto.